Index: fedd/abac-src/ttg/trust/CVS/Entries
===================================================================
--- fedd/abac-src/ttg/trust/CVS/Entries	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/CVS/Entries	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,19 @@
+/CompletionState.java/1.5/Fri Sep 20 18:40:33 2002//
+/Goal.java/1.6/Tue Aug  6 17:50:54 2002//
+/IntersectionTTNode.java/1.3/Thu Aug  1 20:47:45 2002//
+/LinkTTNode.java/1.7/Wed Feb 26 01:01:46 2003//
+/LinkingGoal.java/1.2/Wed Oct  9 23:50:18 2002//
+/LinkingGoalNode.java/1.11/Fri Sep 20 18:40:33 2002//
+/ProcessingState.java/1.11/Wed Oct  9 23:50:18 2002//
+/SatisfactionState.java/1.7/Tue May  7 18:39:11 2002//
+/SimpleTTNode.java/1.51/Fri Feb 28 01:04:31 2003//
+/SimpleTTNode.notes/1.1/Wed Feb 20 18:51:14 2002//
+/StandardTTNode.java/1.9/Fri Nov 15 20:00:18 2002//
+/TTGNode.java/1.28/Thu Sep 19 17:38:37 2002//
+/TTGNodeSet.java/1.4/Fri Apr 19 00:49:19 2002//
+/TargetNode.java/1.34/Sat Nov  9 01:01:58 2002//
+/TrivialTTNode.java/1.22/Fri Jun 14 00:56:26 2002//
+/TrustTarget.java/1.11/Wed Oct  9 23:50:18 2002//
+/TrustTargetParsingException.java/1.1/Fri Jan 25 23:13:47 2002//
+/package.html/1.1/Wed Feb 20 18:51:46 2002//
+D
Index: fedd/abac-src/ttg/trust/CVS/Repository
===================================================================
--- fedd/abac-src/ttg/trust/CVS/Repository	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/CVS/Repository	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,1 @@
+ttg/trust
Index: fedd/abac-src/ttg/trust/CVS/Root
===================================================================
--- fedd/abac-src/ttg/trust/CVS/Root	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/CVS/Root	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,1 @@
+:ext:jjacobs@src.columbia.sparta.com/cvs/abac
Index: fedd/abac-src/ttg/trust/CompletionState.java
===================================================================
--- fedd/abac-src/ttg/trust/CompletionState.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/CompletionState.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,44 @@
+package com.nailabs.abac.trust;
+
+import java.util.*;
+
+/** Simple structure for representing the completion state of a linking goal */
+public class CompletionState extends Observable {
+    /** 
+     * A node is complete when all of its children have either succeeded 
+     * or failed completion states (one state per linking solution child).
+     * @see SatisfactionState.SATISFIED     
+     * @see SatisfactionState.FAILED
+     * */
+    public static final String COMPLETE = "complete";
+
+    /**
+     * A node is complete while any of its linking solution children have an
+     * unknown satisfaction state. 
+     * @see SatisfactionState.UNKNOWN
+     */
+    public static final String INCOMPLETE = "incomplete";
+
+
+    /** encapsulated completion state */
+    private String state = INCOMPLETE;
+
+    /** default constructor */
+    public CompletionState() { }
+
+    /** explicit state constructor */
+    public CompletionState(boolean flag) { 
+        state = (flag)? COMPLETE: INCOMPLETE; 
+    }
+
+    /** accessor method for the completion state field */
+    public boolean isComplete() { return state.equals(COMPLETE); }
+
+    /** modifier method for the completion state field */
+    public void setComplete(boolean flag) { 
+        state = (flag)? COMPLETE: INCOMPLETE; 
+        setChanged();
+        notifyObservers();
+    }
+}
+
Index: fedd/abac-src/ttg/trust/Goal.java
===================================================================
--- fedd/abac-src/ttg/trust/Goal.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/Goal.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,41 @@
+package com.nailabs.abac.trust;
+
+import com.nailabs.abac.process.*;
+import edu.stanford.peer.rbtm.credential.*;
+import java.util.*;
+
+/**
+ * An interface for representing either a trust target or linking goal. Both
+ * subclasses contain a verifier and subject. Target expressions are extended
+ * uniquely.
+ */
+public abstract class  Goal implements java.io.Serializable {
+    /** The verifier of this trust target */
+    protected Entity verifier;
+
+    /** The subject expression of this trust target */
+    protected EntityExpression subject;
+
+    /** accessor method for the subject of this trust target */
+    public EntityExpression getSubject() { return subject; }
+
+    /** accessor method for the verifier of this target */
+    public Entity getVerifier() { return verifier; }
+
+    /** processing state for a node repsenting this goal is added to a TTG */ 
+    public abstract ProcessingState getInitialProcessingState(NegotiationContext ctx);
+
+    /** convert this goal into an XML formatted string */
+    public abstract String toXML();
+
+    /** a string representing the type of the goal */
+    public abstract String getType();
+}
+
+
+
+
+
+
+
+
Index: fedd/abac-src/ttg/trust/IntersectionTTNode.java
===================================================================
--- fedd/abac-src/ttg/trust/IntersectionTTNode.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/IntersectionTTNode.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,108 @@
+package com.nailabs.abac.trust;
+
+import java.util.*;
+import com.nailabs.abac.test.*;
+import com.nailabs.abac.process.*;
+import edu.stanford.peer.rbtm.credential.*;
+
+public class IntersectionTTNode extends TargetNode {
+    TTGNodeSet intersectionChildren = new TTGNodeSet();
+    int k = 0, satisfactionCount = 0;
+
+    public IntersectionTTNode(TrustTarget target) {
+        super(target);
+        k = ((Intersection)target.getTargetRole()).getPartsCount();
+        subName = "Intersection";
+    }
+
+    public void addIntersectionChild(TargetNode child) {
+        intersectionChildren.add(child);
+    }
+
+    protected TTGNodeSet send(TrustTarget source, SatisfactionState state) {
+        TTGNodeSet results = new TTGNodeSet();
+        setState(state);
+        Iterator i = implicationParents.values().iterator();
+        while(i.hasNext()) {
+            try { // this will fail if the parent is a linking goal
+                SatisfactionListener listener = (SatisfactionListener)i.next();
+                TTGNodeSet branchResult = 
+                    listener.receive((TrustTarget)getGoal(), state);
+                if(branchResult == null && branchResult.size() > 0) {
+                    results.addAll(branchResult);
+                }
+            }
+            catch(Exception ex) { // to print out exception uncomment
+                ex.printStackTrace();
+            }
+        }
+        i = controlParents.values().iterator();
+        Strategy strategy = context.getStrategy();
+        while(i.hasNext()) {
+            // add each control parent to the work list
+            strategy.addToWorklist((TTGNode)i.next());
+        } 
+        return results;
+    }
+    
+
+    public  TTGNodeSet receive(TrustTarget source, SatisfactionState state) {
+        debug("satisfaction", getGoal() + " received " + state + " from " +
+              source + " with count = " + satisfactionCount);
+        switch(state.getState()) {
+        case SatisfactionState.SATISFIED:
+            satisfactionCount += 1;
+            if(satisfactionCount < k) {
+                debug("statisfaction", "Intersection received partial satisfaction = " 
+                      + satisfactionCount + "/" + k);
+                break;
+            }
+        case SatisfactionState.FAILED:
+            debug("satisfaction", "Intersection is propagating received " + 
+                  state + " with " + satisfactionCount + "/" + k);
+            return send(source, state);
+        default:
+            debug("satisfaction", "Intersection default received " + 
+                  state + " with " + satisfactionCount + "/" + k);
+        }
+        return new TTGNodeSet();
+    }
+
+    private void intersectionProcess(NegotiationContext context) {
+        debug("satisfaction", "target expression = " + getTargetExpression());
+        Intersection i = (Intersection)getTargetExpression();
+        EntityExpression subject = getSubject();
+        Entity verifier = getVerifier();
+        Iterator parts = i.getParts();
+        //k = i.getPartsCount();
+        
+        while(parts.hasNext()) {
+            EntityExpression aDotR = (EntityExpression)parts.next();
+            try {
+                TrustTarget child = new TrustTarget(verifier, aDotR, subject);
+                context.getGraph().addIntersectionEdge((TrustTarget)getGoal(),
+                                                       child);
+            }
+            catch(Exception ex) {
+                ex.printStackTrace();
+            }
+        }
+    }
+
+    public void opponentProcess(NegotiationContext context) {
+        if(processor.isOpponentProcessed()) {
+            return;
+        }
+        intersectionProcess(context);
+        processor.opponentProcess();
+    }
+
+    public void verifierProcess(NegotiationContext context) {
+        if(processor.isVerifierProcessed()) {
+            return;
+        }
+        intersectionProcess(context);
+        processor.verifierProcess();
+    }
+
+}
Index: fedd/abac-src/ttg/trust/LinkTTNode.java
===================================================================
--- fedd/abac-src/ttg/trust/LinkTTNode.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/LinkTTNode.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,227 @@
+package com.nailabs.abac.trust;
+
+import com.nailabs.abac.process.*;
+import edu.stanford.peer.rbtm.credential.*;
+import java.util.*;
+
+/**
+ * This is a specialized standard trust target which knows how to process 
+ * linked trust targets. 
+ */
+public class LinkTTNode extends StandardTTNode {
+    private LinkingGoal monitorId = null;
+
+    /** default constructor for standard trust target node */
+    public LinkTTNode(TrustTarget target) {
+        super(target);
+        processor = new ProcessingState(false, false);
+        subName = "LinkedTarget";
+    }
+
+    public Role getFirstRole() {
+        LinkedRole role = (LinkedRole)getTargetExpression();
+        return role.getFirstRole();
+    }
+
+    public RoleName getSecondRoleName() {
+        LinkedRole role = (LinkedRole)getTargetExpression();
+        return role.getSecondRoleName();
+    }
+
+    protected void _process(NegotiationContext context) {
+        TTG graph = context.getGraph();
+
+        if(monitorId == null) {
+            try {
+                Entity v = getVerifier();
+                EntityExpression s = getSubject();
+                monitorId = new LinkingGoal(v, getSecondRoleName(), s);
+            } catch (Exception ex) {
+                // add a warning message here--something has gone very wrong
+                return;
+            }
+        }
+        // 1. Add the (unique( linking-monitor edge, T <--< <V: ?X.r2 <<-?- S>
+        if(!children.containsKey(monitorId)) {
+            graph.addLinkingMonitorEdge((TrustTarget)getGoal(), monitorId);
+        }
+
+        // 
+        // This happens when the LinkingGoalNode is processed. It doesn't
+        // actually happen here.
+        //
+        // 2. After (1) is done, V can add a linking implication edge 
+        //    T <--< <V: A.r1 <<-?- B> for each linking-solution edge
+        //    <V: ?X.r2 <<-?- S> <--< <V: B.r2 <<-?- S> such that each
+        //    grandchild (<V: B.r2 <<-?- S>) is satisfied.
+        //
+
+    }
+    
+    /** 
+     * Process a node whose trust target verifier entity is not self 
+     * @see RMINegotiator
+     */
+    public void opponentProcess(NegotiationContext context) {
+        TTG graph = context.getGraph();
+        Entity v = getVerifier();
+        EntityExpression s = getSubject();
+
+        //Initialize the unique id for the linking monitor child linking goal
+        if(monitorId == null) {
+            try {
+                monitorId = new LinkingGoal(v, getSecondRoleName(), s);
+            } catch (Exception ex) {
+                // add a warning message here--something has gone very wrong
+                return;
+            }
+        }
+        // 1. Add the (unique( linking-monitor edge, T <--< <V: ?X.r2 <<-?- S>
+        if(!children.containsKey(monitorId)) {
+            graph.addLinkingMonitorEdge((TrustTarget)getGoal(), monitorId);
+        }
+
+        // 
+        // This happens when the LinkingGoalNode is processed. It doesn't
+        // actually happen here.
+        //
+        // 2. After (1) is done, V can add a linking implication edge 
+        //    T <--< <V: A.r1 <<-?- B> for each linking-solution edge
+        //    <V: ?X.r2 <<-?- S> <--< <V: B.r2 <<-?- S> such that each
+        //    grandchild (<V: B.r2 <<-?- S>) is satisfied.
+        //
+
+        LinkingGoalNode childNode = 
+            (LinkingGoalNode)graph.getNodeByHash(monitorId);
+        _process(context);
+        // 3. Mark this node verifier processed only after both 1 & 2 
+        // are done and <V: ?X.r2 <<-?- S> has a complete completion state.
+        if(childNode.getProcessingState().isOpponentProcessed()
+           && childNode.isComplete()) {
+            graph.setOpponentProcessed(getGoal());
+        }
+    }
+
+
+    /** 
+     * Process a node whose trust target verifier entity is self 
+     * @see RMINegotiator
+     */
+    public void verifierProcess(NegotiationContext context) {
+        FrontierManager fm = context.getFrontier();
+        TTG graph = context.getGraph();
+        RoleName r1 = getFirstRole().getName();
+
+        //
+        // If r1 is issuer-traces-def
+        //
+        if(fm.isIssuerTracesDef(r1)) {
+            if(monitorId == null) {
+                try {
+                    Entity v = getVerifier();
+                    EntityExpression s = getSubject();
+                    monitorId = new LinkingGoal(v, getSecondRoleName(), s);
+                } catch (Exception ex) {
+                    // add a warning message here
+                    // something has gone very wrong!!
+                    return;
+                }
+            }
+            // 1. Add the (unique) linking-monitor edge, 
+            //    T <--< <V: ?X.r2 <<-?- S>
+            if(!children.containsKey(monitorId)) {
+                graph.addLinkingMonitorEdge((TrustTarget)getGoal(), monitorId);
+            }
+            
+            // 
+            // This happens when the LinkingGoalNode is processed. It doesn't
+            // actually happen here.
+            //
+            // 2. After (1) is done, V can add a linking implication edge 
+            //    T <--< <V: A.r1 <<-?- B> for each linking-solution edge
+            //    <V: ?X.r2 <<-?- S> <--< <V: B.r2 <<-?- S> such that each
+            //    grandchild (<V: B.r2 <<-?- S>) is satisfied.
+            //
+
+            // 3. Mark this node verifier processed only after both 1 & 2 
+            // are done and <V: ?X.r2 <<-?- S> has a complete completion state.
+            LinkingGoalNode childNode = 
+                (LinkingGoalNode)graph.getNodeByHash(monitorId);
+            if(childNode.getProcessingState().isVerifierProcessed()
+               && childNode.isComplete()) {
+                   graph.setVerifierProcessed(getGoal());
+            }
+        }
+        //
+        // If r1 is issuer-traces-all
+        //
+        if(fm.isIssuerTracesAll(r1)) {
+            // 1. For each entity B such that A.r1 <<-?- B, and for each e
+            //    such that e is an element of oppoFrontier(B.r2), V can add a
+            //    standard implication edge T,--< <V: e <<-?- S>
+	    Iterator i = 
+		fm.getOppoLocal(getFirstRole()).resultSet().iterator();
+            while(i.hasNext()) {
+		EntityExpression expr=(EntityExpression)i.next();
+		//debug("linked", "issuer-traces-all matched " + cred);
+                try {
+		    if(expr instanceof Entity) { 
+			Entity b = (Entity)expr;
+			Role bDotR2 = new Role(b, getSecondRoleName());
+			Iterator oppoSet = 
+			    fm.getOppoFrontier(bDotR2).resultSet().iterator();
+			while(oppoSet.hasNext()) {
+			    EntityExpression e = (EntityExpression)oppoSet.next();
+			    TrustTarget child = new 
+				TrustTarget(getVerifier(), e, getSubject());
+			    //get evidence here
+			    graph.addImplicationEdge(getGoal(), child, null);
+			}   
+		    }
+                } catch (Exception ex) {
+                    ex.printStackTrace();
+                }
+
+            }
+            // 2. V can mark T as verifier-processed only after step 1 is done
+            graph.setVerifierProcessed(getGoal());
+        }
+    }
+
+    /** 
+     * A comparator function to see if the specified role matches the second 
+     * role name.
+     */
+    protected boolean isLinkingSolution(Role r) {
+        RoleName r2 = getSecondRoleName();
+        
+        return (r2.equals(r.getName()));
+    }
+
+    /**
+     * When the linking child monitor becomes complete, this node needs to
+     * change it's processing state.
+     * @param state The new satisfaction state to be propagated. 
+     */
+    public void receive(LinkingGoal source, CompletionState state) {
+        TTG graph = getContext().getGraph();
+        FrontierManager fm = getContext().getFrontier();
+        Entity me = fm.getSelf();
+        RoleName r1 = getFirstRole().getName();
+        boolean subjectTraceable = fm.isSubjectTraceable(r1);
+        
+        if(state.isComplete() && source.equals(monitorId)) {
+            if(me.equals(getVerifier())) {
+                if(!subjectTraceable) {
+                    //if r1 is not subject traceable
+                    graph.setVerifierProcessed(getGoal());
+                }
+            } else {
+                if(subjectTraceable) {
+                    //if r1 is subject traceable 
+                    graph.setOpponentProcessed(getGoal());
+                }
+            }
+        }
+    }
+}
Index: fedd/abac-src/ttg/trust/LinkingGoal.java
===================================================================
--- fedd/abac-src/ttg/trust/LinkingGoal.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/LinkingGoal.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,98 @@
+package com.nailabs.abac.trust;
+
+import com.nailabs.abac.process.*;
+import edu.stanford.peer.rbtm.credential.*;
+import java.util.*;
+
+/**
+ * An instance of this class represents a linking goal of the form: <BR>
+ * <CENTER> &lt;V: ?X.r2 &lt;-- S &gt; </CENTER> <BR>
+ * where V is on the negotiators; 
+ * r2 is a simple role name; and 
+ * ?X represents entities 
+ * S is a role expression called the subject role. S is frequently the 
+ * opponent negotiator of V.
+ */
+public class LinkingGoal extends Goal {
+    /** The role name suffix (in ?X.r2 this is r2) */
+    private RoleName targetRoleName;
+
+    private Entity x = new SimpleEntity("X");
+
+    /** Itemized default constructor */
+    public LinkingGoal(Entity v, RoleName e, EntityExpression s) 
+        throws TrustTargetParsingException, CredentialParsingException {
+        verifier = v;
+        targetRoleName = e;
+        subject = s;
+    }
+
+    /** Construct a new trust target from a string */
+    public LinkingGoal(String s) 
+        throws TrustTargetParsingException, CredentialParsingException {
+        StringTokenizer st = new StringTokenizer(s, ":<-? ");
+        try {
+            verifier = new SimpleEntity(st.nextToken());
+            StringTokenizer rt = new StringTokenizer(st.nextToken(), ".");
+            x = new SimpleEntity(rt.nextToken());
+            targetRoleName = new SimpleRoleName(rt.nextToken());
+            subject = new SimpleEntity(st.nextToken());
+        } catch (NoSuchElementException nonesuch) {
+            throw new TrustTargetParsingException("Bad linking goal: ", s);
+        }
+
+    }
+
+    /** Unique hash function based on a verifier-target-subject triplet */
+    public int hashCode() {
+        return verifier.hashCode() * 4 + targetRoleName.hashCode() * 2 + 
+            subject.hashCode();
+    }
+    /** processing state for a node repsenting this goal is added to a TTG */ 
+    public ProcessingState  getInitialProcessingState(NegotiationContext ctx) {
+        // a linking goal is initially verifier-processed */
+        return new ProcessingState(true, false); 
+    }
+    
+    /** accessor method for the target role expressin of this target */
+    public RoleName getTargetRoleName() { return targetRoleName; }
+
+    /** type name for pretty printing an instance */
+    public String getType() {
+        return new String("LinkingGoal");
+    }
+
+    public String toString() {
+	StringBuffer buff = new StringBuffer();
+	buff.append(getVerifier().toString()).append(": ");
+	buff.append("?").append(x).append(".").append(targetRoleName);
+	buff.append(" <<-?- ").append(getSubject().toString());
+	return buff.toString();
+    }
+
+    public String toXML() {
+    /*
+	StringBuffer buff = new StringBuffer("<LinkingGoal>\n");
+	buff.append("\t<Verifier>");
+	buff.append(getVerifier().toString());
+	buff.append("</Verifier>\n");
+	buff.append("\t<TargetRoleName>");
+	buff.append(targetRoleName.toString());
+	buff.append("</TargetRoleName>\n");
+	buff.append("\t<Subject>");
+	buff.append(getSubject().toString());
+	buff.append("</Subject>\n");
+	buff.append("</TrustTarget>\n");
+	return buff.toString();	
+    */
+        return toString().replaceAll("<", "&lt;");
+    }
+}
+
+
+
+
+
+
+
+
Index: fedd/abac-src/ttg/trust/LinkingGoalNode.java
===================================================================
--- fedd/abac-src/ttg/trust/LinkingGoalNode.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/LinkingGoalNode.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,220 @@
+/*
+ * Copyrighted (C) 2002, Networks Associates Technology, Inc. 
+ * All rights reserved
+ */
+package com.nailabs.abac.trust;
+
+import com.nailabs.abac.process.*;
+import com.nailabs.abac.test.*;
+import edu.stanford.peer.rbtm.credential.*;
+import java.util.*;
+import java.io.*;
+
+/**
+ * A trust target graph node, representing a linking goal. This node has a 
+ * triplet uniqueness based on the verifier, rolename, and subject. It can
+ * have multiple parents (via linking monintor edges) and multiple childen
+ * (via linking solution edges).
+ */
+public class LinkingGoalNode extends TTGNode implements SatisfactionListener {
+
+    // Node state information constants
+
+    /** Reserved for future use */
+    public static final String OPAQUE = "opaque";
+
+    private CompletionState state = new CompletionState();
+    
+    private int completionCount = 0;
+
+    /** string constructor */
+    public LinkingGoalNode(String goal) 
+        throws TrustTargetParsingException, CredentialParsingException {
+        this(new LinkingGoal(goal));
+    }
+    
+    /** parsed object constructor */
+    public LinkingGoalNode(Entity verifier, RoleName target, Entity subject) 
+        throws TrustTargetParsingException, CredentialParsingException {
+        this(new LinkingGoal(verifier, target, subject));
+    }
+
+    /** default constructor */
+    public LinkingGoalNode(LinkingGoal goal) {
+        super(goal);
+        subName = "LinkingGoal";
+        state.addObserver(this);
+    }
+
+    /** 
+     * Notify observers that this node's completion state has been changed.
+     */
+    public void update(Observable obs, Object obj) {
+        if(obs == state) {
+            setChanged();
+            notifyObservers(state);
+        } else {
+            super.update(obs, obj);
+        }
+    }
+
+
+    /** 
+     * Each distinct node type should know how to process itself, so this 
+     * method should be overridden in subclasses. 
+     * @param context A context w/helper functions required for processing
+     */
+    public void verifierProcess(NegotiationContext context) {
+        //this case should not occur
+    }
+ 
+    /** 
+     * Each distinct node type should know how to process itself, so this 
+     * method should be overridden in subclasses. 
+     * @param context A context w/helper functions required for processing
+     */
+    public void opponentProcess(NegotiationContext context) {
+        TTG graph = context.getGraph();
+        LinkingGoal goal = (LinkingGoal)getGoal();
+        FrontierManager f = context.getFrontier();
+        Entity verifier = goal.getVerifier();
+        EntityExpression subject = goal.getSubject();
+        HashSet solutions = new HashSet();
+
+        debug("linking-goal", "Opponent processing " + goal);
+        // (1) O adds a linking solution edge G <--< <V: A.r2 <<-?- S>, for 
+        //     any A.r2 which is an element of sensitiveRole(O) or 
+        //     A.r2 defined by a credentials in CsuperS(O)
+
+        // collect the sensitive roles which match with r2
+        Iterator sensitiveRoles =
+            f.getAckPolicy().getSensitiveRoles().iterator();
+        while(sensitiveRoles.hasNext()) {
+            Role sensitive = (Role)sensitiveRoles.next();
+            if(sensitive.getName().equals(getTargetRoleName())) {
+                solutions.add(sensitive);
+                debug("linking-goal", "found sensitive role = " + sensitive);
+            }
+        }
+        // add the roles (r2) where it is definied by a credential
+        Iterator defined = f.getCredentialsDefiningRole(getTargetRoleName());
+        if(!defined.hasNext()) {
+            debug("linking-goal", "no credentials foudn defining role: " +
+                  getTargetRoleName());
+        }
+        while(defined.hasNext()) {
+            StaticCredential credential = (StaticCredential)defined.next();
+            Role solution = credential.getDefinedRole();
+            solutions.add(solution);
+            debug("linking-goal", "found matching r2 = " + solution);
+        }
+        // iterate through the solution and add the linking solution edges
+        Iterator i = solutions.iterator();
+        while(i.hasNext()) {
+            try {
+                Role solution = (Role)i.next();
+                TrustTarget child = 
+                    new TrustTarget(verifier, solution, subject);
+                graph.addLinkingSolutionEdge(goal, child);
+            } catch(Exception ex) {
+                ex.printStackTrace();
+            }
+        }
+        // (2) O can mark this node opponent-processed only after (1) is done.
+        graph.setOpponentProcessed(goal);
+    }
+
+    public void addLinkingImplicationEdges(TrustTarget target) {
+        NegotiationContext context = getContext();
+        FrontierManager fm = context.getFrontier();
+
+        Entity v = getVerifier();
+        Entity b =  ((Role)target.getTargetRole()).getBase();
+        TTG graph = getContext().getGraph();
+        Iterator i = parents.values().iterator();
+        
+        while(i.hasNext()) {
+            try {
+                LinkTTNode parent = (LinkTTNode)i.next();
+                RoleName r1 =  parent.getFirstRole().getName();   
+                boolean subjectTraceable = fm.isSubjectTraceable(r1);
+                if(context.getSelf().equals(getVerifier())) { 
+                    // if we're the verifier
+                    if(!subjectTraceable) {     
+                        // check r1 that is not subject traceable
+                        TrustTarget parentTarget = 
+                            (TrustTarget)parent.getGoal();
+                        TrustTarget child = 
+                            new TrustTarget(v, parent.getFirstRole(), b);
+                        graph.addLinkingImplicationEdge(parentTarget, child); 
+                    }
+                } else {
+                    // else we are the opponent
+                    if(subjectTraceable) {
+                        // check r1 that is not subject traceable
+                        TrustTarget parentTarget = 
+                            (TrustTarget)parent.getGoal();
+                        TrustTarget child = 
+                            new TrustTarget(v, parent.getFirstRole(), b);
+                        graph.addLinkingImplicationEdge(parentTarget, child); 
+                    }                
+                }
+            } catch(Exception ex) {
+                ex.printStackTrace();
+            }
+        }
+    }
+
+    /** 
+     * A linking goal uses this interface to act as a monitor for its own
+     * completion state and to add linking-implication edges 
+     */ 
+    public TTGNodeSet receive(TrustTarget target, SatisfactionState state) {
+        // a satisfied linking solution does step 2 in linked role processing
+        if(state.getState() == SatisfactionState.SATISFIED) {
+            debug("linking-goal", "received SATISFIED from " + target);
+            addLinkingImplicationEdges(target);
+        }
+        // Just in case we get unknown satisfaction state propagation check 
+        //for it here to make certain we have an accurate completion count
+        if(state.getState() != SatisfactionState.UNKNOWN) {
+            completionCount++;
+            if(completionCount <= children.size()) {
+                this.state.setComplete(true);
+            }
+        }
+        // if this node is complete, we should notify the parent(s) 
+        if(isComplete()) {
+            Iterator i = parents.values().iterator();
+            notifyObservers(this.state);
+
+            while(i.hasNext()) {
+                LinkTTNode parent = (LinkTTNode)i.next();
+                parent.receive((LinkingGoal)getGoal(), 
+                               new CompletionState(true) );
+            }
+        }
+        return new TTGNodeSet();
+    }
+
+    public boolean isComplete() { 
+        return state.isComplete();
+    }
+
+    /** convenience method for extracting the target role name for this node */
+    public RoleName getTargetRoleName() {
+        return ((LinkingGoal)getGoal()).getTargetRoleName();
+    }
+
+    public String toXML() {
+        // Add node state here (eg. in/complete, etc.)
+        StringBuffer state = new StringBuffer("state=\"");
+        state.append(this.state);
+        // Add linking solutions if any */
+        return toXML(state.toString(), "");
+    }
+
+}
+
+
+
Index: fedd/abac-src/ttg/trust/ProcessingState.java
===================================================================
--- fedd/abac-src/ttg/trust/ProcessingState.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/ProcessingState.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,143 @@
+package com.nailabs.abac.trust;
+
+import java.util.*;
+import java.io.*;
+import com.nailabs.abac.test.XMLizable;
+
+/** 
+ * A class to represent the processing state of a TTGNode instance. A node is
+ * considered fully processed when the state is both verifier and opponent 
+ * processed. This class is serializable for use in node operations.
+ */
+public class ProcessingState extends Observable 
+    implements Serializable, XMLizable {
+    /** internal state variable, set if the verifier has processed a node */
+    private boolean verifierProcessed = false;
+
+    /** internal state variable, set if the opponent has processed a node */
+    private boolean opponentProcessed = false;
+
+    /** 
+     * Default constructor for a state where <EMP>NO</EMP> processing has 
+     * occured.
+     */
+    public ProcessingState() { }
+    
+    /** Explicit constructor method for setting state */
+    public ProcessingState(boolean v, boolean o) {
+	verifierProcessed = v;
+	opponentProcessed = o;
+    }
+    
+    /** Jared: Added this method to make XML processing easier */
+    public void setVerifierProcessed() {
+        verifierProcessed = true;
+    }
+    
+    /** Jared: Added this method to make XML processing easier */
+    public void setOpponentProcessed() {
+        opponentProcessed = true;
+    }
+    
+    /** Jared: Added this method to make XML processing easier */
+    public void setFullyProcessed() {
+        setVerifierProcessed();
+        setOpponentProcessed();
+    }
+    
+    /** Jared: Added this method to make XML processing easier */
+    public void setUnprocessed() {
+        verifierProcessed = false;
+        opponentProcessed = false;
+    }
+    
+    /** Jared: Added this method to make XML processing easier */
+    public void setProcessingState(String state) {
+        if(state.equals("Fully Processed")) setFullyProcessed();
+        else if(state.equals("Verifier Processed")) setVerifierProcessed();
+        else if(state.equals("Opponent Processed")) setOpponentProcessed();
+        else if(state.equals("Unprocessed")) setUnprocessed();
+    }
+
+    /** method used to indicate that this node has been verifier processed */
+    public void verifierProcess() { 
+	verifierProcessed = true; 
+	setChanged();
+	notifyObservers();
+    }
+
+    /** method used to indicate that this node has been opponent processed */
+    public void opponentProcess() { 
+	opponentProcessed = true; 
+	setChanged();
+	notifyObservers();
+    }
+
+    /** boolean query to find out if the node has been verifier processed */
+    public boolean isVerifierProcessed() { return verifierProcessed; }
+
+    /** boolean query to find out if the node has been opponent processed */
+    public boolean isOpponentProcessed() { return opponentProcessed; }
+
+    /** 
+     * boolean query to find out if the node was processed by opponent and
+     * and verifier.
+     */
+    public boolean isFullyProcessed() { 
+	return (verifierProcessed && opponentProcessed);
+    }
+
+    /** Update the processing state by duplicating the the specified state */
+    public void update(ProcessingState state) {
+	//if(state == null)return;
+	verifierProcessed |= state.isVerifierProcessed();
+	opponentProcessed |= state.isOpponentProcessed();
+	setChanged();
+	notifyObservers();
+    }
+
+    
+    /** convert this instance into XML formatted text */
+    public String toXML() {
+	StringBuffer buff = new StringBuffer("<ProcessingState>");
+	String value;
+	if(isFullyProcessed()) {
+	    value =  "Fully Processed";
+	}
+	else if(isVerifierProcessed()) {
+	    value = "Verifier Processed";
+	}
+	else if(isOpponentProcessed()) {
+	    value = "Opponent Processed";
+	}
+	else {
+	    value = "Unprocessed";
+	}
+	buff.append(value).append("</ProcessingState>");
+	return buff.append("\n").toString();
+    }
+
+    /** Convert this instance into human readable format */
+    public String toString() {
+	if(isFullyProcessed()) {
+	    //return "[Fully Processed]";
+        return "fully";
+	}
+	else if(isVerifierProcessed()) {
+	    //return "[Verifier Processed]";
+        return "verifier";
+	}
+	else if(isOpponentProcessed()) {
+	    //return "[OpponentProcessed]";
+        return "opponent";
+	}
+	else {
+	    //return "[Unprocessed]";
+        return "unprocessed";
+	}
+    }
+
+}
+
+
+
Index: fedd/abac-src/ttg/trust/SatisfactionState.java
===================================================================
--- fedd/abac-src/ttg/trust/SatisfactionState.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/SatisfactionState.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,83 @@
+package com.nailabs.abac.trust;
+
+import java.util.*;
+import com.nailabs.abac.test.XMLizable;
+/**
+ * An instance used to represent the satisfaction state of a target node
+ * and its descendants.
+ */
+public class SatisfactionState extends Observable implements XMLizable {
+    /** The satisfaction state variable */
+    private int state;
+
+    /** 
+     * The satisfaction state can be proved to be satisfied or unsatisfied.
+     * For example, an access mediator may want to later reassess a subgraph.
+     */
+    public static final int UNKNOWN = 0;
+
+    /**
+     * Satisfaction mean that a trust target node has been proven correct,
+     * possibly including a set of credential to verify the satisfaction.
+     */
+    public static final int SATISFIED = 1;
+
+    /**
+     * Unsatisified mean that the requirement of a trust target cannot be 
+     * met. This generally means that an access mediator should not allow
+     * resource access.
+     */
+    public static final int FAILED = 2;
+
+    /** Default constructor where the state is UNKNOWN */
+    public SatisfactionState() { state = UNKNOWN; }
+
+    /** Explicitly defined statisfaction state. */    
+    public SatisfactionState(int i) { state = i; }
+
+    /** Accessor method for returninf the trust target satisfaction state. */
+    public int getState() { return state; }
+
+    /** Modifier method to change the satisfaction state */
+    public void setState(int i) { 
+	if(i > -1 && i < 3)state = i; 
+	setChanged();
+	notifyObservers();
+    }
+
+    /** convert this instance into an XML formatted string */
+    public String toXML() {
+	StringBuffer buff = new StringBuffer("<SatisfactionState>");
+	switch(state) {
+	case SATISFIED: 
+	    buff.append("satisfied");
+	    break;
+	case FAILED:
+	    buff.append("failed");
+	    break;
+	default:
+	    buff.append("unknown");
+	}
+	buff.append("</SatisfactionState>");
+	return buff.append("\n").toString();
+    }
+
+
+    /** Print a human readable version of this instance */
+    public String toString() {
+	StringBuffer buff = new StringBuffer("[");
+	switch(state) {
+	case SATISFIED: 
+	    buff.append("satisfied");
+	    break;
+	case FAILED:
+	    buff.append("failed");
+	    break;
+	default:
+	    buff.append("unknown");
+	}
+	return buff.append("]").toString();
+    }
+    
+}
+
Index: fedd/abac-src/ttg/trust/SimpleTTNode.java
===================================================================
--- fedd/abac-src/ttg/trust/SimpleTTNode.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/SimpleTTNode.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,339 @@
+package com.nailabs.abac.trust;
+
+import edu.stanford.peer.rbtm.credential.*;
+import edu.stanford.peer.rbtm.util.*;
+import com.nailabs.abac.process.*;
+
+import java.util.*;
+
+/**
+ * A simple trust target node which contains a standard target of the form:
+ * &lt;V: A.r <<-- S&gt;.
+ *
+ * @version $Id: SimpleTTNode.java,v 1.51 2003/02/28 01:04:31 jjacobs Exp $
+ */
+public class SimpleTTNode extends StandardTTNode {
+    /** Child nodes which form control edges in the TTG */
+    protected TTGNodeSet controlChildren = new TTGNodeSet();
+
+    /** Linking goals to whoch this node is a solution */
+    protected TTGNodeSet linkingSolutionParents = new TTGNodeSet();
+    
+    /** A flag to signal whether to complete step (4) in opponentSensProcess */
+    protected boolean isSensFrontiered = false;
+
+    /** Constructor which used a single trust target */
+    public SimpleTTNode(TrustTarget target) {
+	super(target);
+	processor = new ProcessingState(false, false);
+	subName = "StandardTarget";
+    }
+
+    /** Convenience constructor which also creates a trust target */
+    public SimpleTTNode(Entity v, Role r, EntityExpression subject) 
+	throws CredentialParsingException, TrustTargetParsingException
+    {
+	this(new TrustTarget(v, (EntityExpression)r, subject));
+    }
+
+    /** Convenience accessor method for the target role expression */
+    public Role getRoleExpression() { 
+	return (Role)((TrustTarget)getGoal()).getTargetRole(); 
+    }
+
+    /** Processing that occurs if this negotiation context is the verifier */
+    public void verifierProcess(NegotiationContext context) {
+	TTGNodeSet children = new TTGNodeSet();
+	FrontierManager frontier = context.getFrontier();
+	TTG graph = context.getGraph();
+	Iterator subjects  = 
+	    frontier.getCredentialsDefiningRole(getRoleExpression());
+        debug("satisfaction", "found subjects for "+ getRoleExpression() + 
+              " = " + (subjects.hasNext()));
+	while(subjects.hasNext()) {
+	    StaticCredential cred = (StaticCredential)subjects.next();
+	    EntityExpression e = cred.getSubject();
+        debug("satisfaction", "e = " + e);
+	    ResultEvidenceMap map = frontier.getOppoFrontier(e);
+	    if(map == null)break; // no e prime's so go to next e
+	    Iterator oppoFrontier = map.resultSet().iterator();
+	    while(oppoFrontier.hasNext()) {
+		EntityExpression ePrime =(EntityExpression)oppoFrontier.next();
+		//add edge not node
+		TrustTarget childTarget = createTarget(context, ePrime);
+		//TTGNode child = graph.getNode((Goal)childTarget);	
+		//perform the operation on graph & add to message w/ evidence
+		if(!implicationChildren.values().contains(childTarget)) { 
+		    HashSet chain = frontier.getOppoChain(e, ePrime);
+		    chain.add(cred);
+		    debug("evidence", 
+			  "chain(" + e + "," + ePrime + ") = " + chain);
+		    graph.addImplicationEdge(getGoal(), childTarget, chain);
+		    //add child to list of child for the worklist
+		    children.add(graph.getNodeByHash(childTarget));
+		}
+	    }
+	}
+	graph.setVerifierProcessed(getGoal());
+    }
+
+    /** opponent process non-sensitive target or its subject isn't opponent */
+    private void  opponentProcess(NegotiationContext context, 
+					   ResultEvidenceMap frontier, boolean isSimp) 
+	throws CredentialParsingException, TrustTargetParsingException  {
+	TTGNodeSet children = new TTGNodeSet();
+	Role aDotR = getRoleExpression();
+	Entity s = (Entity)getSubject();
+	Entity v = (Entity)getVerifier();
+	Entity o = context.getOpponent();
+	TTG graph = context.getGraph();
+    
+	debug("process", "frontier = " + frontier.toString());
+	// (1) If S is a member of simpFrontier(A.r), or
+	// (1) If O is a member of sensFrontier(A.r)
+	if(frontier.resultSet().contains(s)) {
+	    debug("process", "frontier contains subject");
+	    // then O can add implication edge T <--< <V: S <<-- S>
+	    // or O can add implication edge T <--< <V: O <<-- O>
+	    TrustTarget child = new TrustTarget(v, s, s);
+	    TrivialTTNode childNode =(TrivialTTNode)graph.getNodeByHash(child);
+	    if(!implicationChildren.values().contains(childNode)) { 
+            HashSet evidence = (isSimp)? 
+                context.getFrontier().getSimpChain(aDotR, s):
+                context.getFrontier().getSensChain(aDotR, s);
+            // this case should always happen but possibly might not
+            graph.addImplicationEdge(getGoal(), child, evidence);
+            children.add(graph.getNodeByHash(child));
+	    }
+	}
+	// (2) If S not a member of simpFrontier or
+	//        O is not a member of sensFrontier
+	else {
+	    debug("process","fontier doesn't contain subject " + s);
+	    // then for each e in sens- or simp-Frontier(A.r)
+	    Iterator expressions = frontier.resultSet().iterator();
+	    while(expressions.hasNext()) {
+            EntityExpression e = (EntityExpression)expressions.next();
+            // that is not an entity
+            if(e instanceof Entity)continue;
+            TrustTarget child = new TrustTarget(v, e, s);
+            TargetNode childNode =  (TargetNode)graph.getNodeByHash(child);
+            if(!implicationChildren.values().contains(childNode)) {
+                // O can add an implication edge T <--< <V: e <-- S>
+                // or an implication edge T <--< <V: e <-- O>
+                HashSet evidence = (isSimp)? 
+                    context.getFrontier().getSimpChain(aDotR, e):
+                    context.getFrontier().getSensChain(aDotR, e);
+                graph.addImplicationEdge(getGoal(), child, evidence);
+                children.add(graph.getNodeByHash(child));
+            }
+	    }
+	}
+	// (3) If this node is satisfied or both (1) & (2) are done
+	graph.setOpponentProcessed(getGoal());
+    }
+
+    /** opponent process a sensitive role */
+    private void opponentSensProcess(NegotiationContext context) 
+	throws CredentialParsingException, TrustTargetParsingException  {
+	TTGNodeSet children = new TTGNodeSet();
+	EntityExpression s = getSubject();
+	// In the crrent case self is always the opponent of the verifier.
+	Entity o = context.getSelf(); //context.getOpponent();
+	Entity v = getVerifier();
+	Role aDotR = getRoleExpression();
+	EntityExpression self = context.getSelf();
+	TTG graph = context.getGraph();
+	TargetNode ackChild, acChild = null;
+	FrontierManager frontier = context.getFrontier();
+
+	debug("process", "------------Begin opponentSensProcess-------------");
+	// (1) add control edge T <--< <O: eAck <<-- V>
+	EntityExpression eAck = context.getAck(aDotR);
+	
+	TrustTarget ackTarget = new TrustTarget((Entity)self, eAck, v);
+	ackChild = (TargetNode)graph.getNodeByHash(ackTarget);
+	if(!controlChildren.values().contains(ackChild)) {
+	    graph.addControlEdge(getGoal(), (Goal)ackTarget);
+	    ackChild = (TargetNode)graph.getNodeByHash(ackTarget);
+	    children.add(ackChild);
+	}
+	debug("process", "---------- Begin step 2-------------------------");
+	// (2) If <O: eAck <<-- V) is satisfied and if O has the credential
+	//     A.r <-- O  in its credential store
+	StaticCredential cred = new StaticCredential(aDotR, o);
+	EntityExpression eAC = context.getAC(cred);
+	if(ackChild.getSatisfactionValue() == SatisfactionState.SATISFIED) {
+        // Is A.r <-- O  in its credential store?
+        debug("process", "eAC = " + eAC);
+        debug("process", "cred = " + cred);
+	// The importance here is that cred exists not that cred is self-
+	// reachable. This is a sanity check.
+        if(context.getFrontier().isSelfReachable(cred)) {
+            // O can add the control edge T <--< <O: eAC <-- V>, where 
+            // AC = AC(O)[A.r <- O]
+            if(eAC != null) {
+                Goal acTarget = (Goal)new TrustTarget(o, eAC, v);
+                acChild = (TargetNode)graph.getNodeByHash(acTarget);
+                debug("process", "acChild = " + acChild);
+                if(!controlChildren.values().contains(acChild)) {
+                    graph.addControlEdge(getGoal(), acTarget);
+                    acChild = (TargetNode)graph.getNodeByHash(acTarget);
+                    children.add(acChild);
+                }
+	    }
+            debug("process", "---------- Begin step 3----------------------");
+	       // (3) If <O: eAC <<-- V> is satisfied, O can add the 
+	       //     implication edge T <-- <V: O <<-- O>
+	       if(acChild == null || 
+		  acChild.getSatisfactionValue()==SatisfactionState.SATISFIED){
+		   TargetNode cnode = 
+		     (TargetNode)graph.getNodeByHash(new TrustTarget(v, o, o));
+		   TrustTarget child = new TrustTarget(v, o, o);
+		   debug("process", "child = " + child);
+		   if(!implicationChildren.values().contains(cnode)) { 
+               //frontier.getSensChain(aDotR, o);
+               HashSet chain = new HashSet();
+               chain.add(cred);
+		       graph.addImplicationEdge(getGoal(), child, chain);
+		       children.add(graph.getNodeByHash(child));
+		   }
+           debug("process", "---------- Begin step 5-----------------------");
+		   // (5) Mark T as opponent processed
+		   graph.setOpponentProcessed(getGoal());
+		   return;
+	       }
+	   }
+	   else {
+	       // (5) Mark T as opponent procressed (because there is no AC policy)
+	       graph.setOpponentProcessed(getGoal());
+	       return;
+	   }
+	}
+	// (4) For e in sensFrontier(A.r) that is not an entity,
+	//     O can add an implication edge T <--< <V: e <<-- O>
+	// TBD: this needs to be modified to be the frontiers of all
+	//      the children credentials of A.r
+	debug("process", "Entering Step 4");
+	debug("process", "A.r = " + aDotR + ", o = " + o + ", v = " + v);
+	Iterator creds = frontier.getCredentialsDefiningRole(aDotR);
+
+	while(creds.hasNext()) {
+	    StaticCredential definingCred = (StaticCredential)creds.next();
+        EntityExpression subjectRole = definingCred.getSubject();
+	    ResultEvidenceMap sensFrontier = frontier.getSensFrontier(subjectRole);
+	    Iterator sens = sensFrontier.resultSet().iterator();
+	    debug("process", "sensfrontier = " + sensFrontier.resultSet());
+	    debug("process", "subject role = " + subjectRole);
+	
+	    while(sens.hasNext() && !isSensFrontiered) {
+		EntityExpression e = (EntityExpression)sens.next();
+		debug("process", "found sensitive role = " + e);
+		if(e instanceof Entity)continue; // skip entities
+		TrustTarget tt = new TrustTarget(v, e, o);
+		TargetNode frontierChild = (TargetNode)graph.getNodeByHash(tt);
+		if(!implicationChildren.values().contains(frontierChild)) { 
+            HashSet chain = frontier.getSensChain(subjectRole, e);
+            chain.add(definingCred);
+		    graph.addImplicationEdge(getGoal(), tt, chain);
+		    children.add(graph.getNode(tt));
+		}
+	    }
+	    isSensFrontiered = true;
+	}
+	debug("process", "------------End opponentSensProcess-------------");
+
+    }
+
+    /** 
+     * Processing that occurs if the negotiation for this context is the
+     * the opponent. This method matches the algorithm in section 5.4
+     */
+    public void opponentProcess(NegotiationContext context) {
+	EntityExpression s = getSubject();
+	//Entity o = context.getOpponent();
+	Entity o = context.getSelf();
+	Role aDotR = getRoleExpression();
+	FrontierManager frontier = context.getFrontier();
+	debug("process", "opponent processing -- " + toString());
+	try {
+	    if(!o.equals(s)) {
+		debug("process", "opponent processing with simp frontier");
+		opponentProcess(context, frontier.getSimpFrontier(aDotR), true);
+	    }
+	    else if(frontier.isSensitive(aDotR)) {
+		debug("process", 
+		      "opponent processing sensitive role: " + aDotR);
+		opponentSensProcess(context);
+	    }
+	    else {
+		debug("process", "opponent processing with sens frontier");
+		opponentProcess(context, frontier.getSensFrontier(aDotR), false);
+	    }
+	} catch(Exception ex) {
+	    debug("process", "WARNING ONLY!");
+	    ex.printStackTrace();
+	    debug("process", "WARNING ONLY!");
+	}
+    }
+
+
+    private boolean addControlEdge(Entity v, 
+				   EntityExpression e, 
+				   EntityExpression s) {
+	return false;
+    }
+
+
+    /**
+     * Records the new state and then propagates it to the parent listeners.
+     * @param state The new satisfaction state to be propagated. 
+     */
+    public  TTGNodeSet receive(TrustTarget source, SatisfactionState state) {
+        TTGNodeSet results = super.receive(source, state);
+        Iterator i = linkingSolutionParents.values().iterator();
+        while(i.hasNext()) {
+            try { // this will fail if the parent is a linking goal
+                LinkingGoalNode parent = (LinkingGoalNode)i.next();
+                TTGNodeSet branchResult = 
+                    parent.receive((TrustTarget)getGoal(), state);
+                if(branchResult == null && branchResult.size() > 0) {
+                    results.addAll(branchResult);
+                }
+            }
+            catch(Exception ex) { // to print out exception uncomment
+                ex.printStackTrace();
+            }
+        }
+        return results;
+    }
+
+    /** Add a linking solution parent to this node */
+    public void addLinkingSolutionParent(LinkingGoalNode parent) {
+        if(parent != null){ 
+            debug("node", "adding implication parent");
+            linkingSolutionParents.add(parent);
+            parent.receive((TrustTarget)getGoal(), satisfier);
+        }
+    }
+
+    /** Add a control child to this node */
+    public void addControlChild(TargetNode child) {
+	controlChildren.add(child);
+    }
+
+    /** 
+     * Convenience method for creating a target and catching potential
+     * exceptions that may occur. 
+     */
+    protected TrustTarget createTarget(NegotiationContext context, 
+				       EntityExpression ex) {
+	try {
+	    return new TrustTarget(context.getSelf(), ex, getSubject());
+	}
+	catch(Exception x) {
+	    x.printStackTrace();
+	}
+	return null;
+    }
+}
Index: fedd/abac-src/ttg/trust/SimpleTTNode.notes
===================================================================
--- fedd/abac-src/ttg/trust/SimpleTTNode.notes	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/SimpleTTNode.notes	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,13 @@
+// rule 3
+if ackchild is satisfied {
+  if cred doesn't exist { 
+    mark node processed 
+  } else {
+    if eAC = AC[cred] != null {
+      get ACchild 
+      if ACchild is satisfied { 
+        add implication child
+        mark node processed
+      }
+    }
+  }
Index: fedd/abac-src/ttg/trust/StandardTTNode.java
===================================================================
--- fedd/abac-src/ttg/trust/StandardTTNode.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/StandardTTNode.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,99 @@
+package com.nailabs.abac.trust;
+
+import com.nailabs.abac.trust.*;
+import com.nailabs.abac.test.*;
+import java.util.*;
+
+/**
+ * This class handles the common functionality of the <CODE>SimpleTTNode</CODE>
+ * and the <CODE>LinkTTNode</CODE> to be processed as parents of implication
+ * edges.
+ */
+public abstract class StandardTTNode extends TargetNode {
+
+    /**
+     * Keepa track of the number of implication children which have failed.
+     * When this counter reaches the number of implication children then,
+     * failed satisfaction state will be propagated up to the parent.
+     */
+    protected int implicationFailures = 0;
+
+    /**
+     * Standard target nodes have implication children. This field is 
+     * inherited to all subclasses.
+     */
+    protected TTGNodeSet implicationChildren = new TTGNodeSet();
+
+    public StandardTTNode(TrustTarget target) {
+	super(target);
+    }
+
+
+    /**
+     * Records the new state and then propagates it to the parent listeners.
+     * This method is specifically designed to handle failure propagation and
+     * make sure all children have failed before sending the failure up to the
+     * ancestors in the graph.
+     * @param state The new satisfaction state to be propagated. 
+     */
+    public  TTGNodeSet receive(TrustTarget source, SatisfactionState state) {
+        if(state.getState() == SatisfactionState.FAILED) {
+            implicationFailures++;
+            //if(++implicationFailures < implicationChildren.size()) {
+            if(!isFailed()) {
+                debug("satisfaction", "partial failure" + implicationFailures +
+                      "/" + implicationParents.size());
+                //bail out for now...
+                return new TTGNodeSet();
+            }
+        }
+        return super.receive(source, state);
+    }
+
+    protected boolean isFailed() {
+        if(!Debug.sendFailure()) {
+            debug("satisfaction","failure is turned off!!");
+            return false;
+        }
+        if(!processor.isFullyProcessed()) {
+            return false;
+        }
+        if(processor.isFullyProcessed() && implicationChildren.size() == 0) {
+           return true;
+       }
+       Iterator i = implicationChildren.values().iterator();
+       while(i.hasNext()) {
+           TargetNode child = (TargetNode)i.next();
+           if(child.getSatisfactionValue() != SatisfactionState.FAILED) {
+               return false;
+           }
+       }
+       return true;             // all false so we fail here
+    }
+
+    /**
+     * handle satisfaction state failure propagation 
+     */
+    public void updateProcessingState(ProcessingState state) {
+        getProcessingState().update(state);
+        if(isFailed()) {
+            SatisfactionState failure = 
+                new SatisfactionState(SatisfactionState.FAILED);
+            receive(null, failure);
+        }            
+    }
+
+    /** 
+     * Adds an implication edge to this node. This creates an implication
+     * edge between parent and child. 
+     */
+    public void addImplicationChild(TargetNode child) {
+	if(child != null) {
+	    implicationChildren.add(child);
+	    setChanged();
+	    notifyObservers(this);
+	}
+    }
+
+
+}
Index: fedd/abac-src/ttg/trust/TTGNode.java
===================================================================
--- fedd/abac-src/ttg/trust/TTGNode.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/TTGNode.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,214 @@
+/*
+ * Copyrighted (C) 2002, Networks Associates Technology, Inc. 
+ * All rights reserved
+ */
+package com.nailabs.abac.trust;
+
+import com.nailabs.abac.process.*;
+import com.nailabs.abac.test.*;
+import edu.stanford.peer.rbtm.credential.*;
+import java.util.*;
+import java.io.*;
+
+/**
+ * A generic node type for a trust target graph (TTG). The node encapsulates
+ * a trust target and provides methods for processing a node. 
+ */
+public abstract class TTGNode extends Observable 
+    implements Observer, Serializable, XMLizable {
+
+    /** A trust target that this node represents on the graph */
+    private Goal goal = null;
+
+    /** A negotiation context which binds graph, strategy, and frontiers */
+    protected NegotiationContext context;
+
+    /** The processing state of this graph node */
+    protected transient ProcessingState processor = new ProcessingState();
+
+    /** Encapsulated set of parents for a TTG node */
+    protected TTGNodeSet parents = new TTGNodeSet();
+
+    /** Encapsulated set of children for a TTG node */
+    protected TTGNodeSet children = new TTGNodeSet();
+    
+    /** Convenience debugging name to be overridden in subclasses */
+    protected String subName = "TTGNode";
+
+    /** Generic node factory method which creates a node based on a goal */
+    public static TTGNode createNode(Goal seed) {
+        if(seed instanceof TrustTarget) {
+            EntityExpression target = ((TrustTarget)seed).getTargetRole();
+            if(target instanceof Entity) {
+                return new TrivialTTNode((TrustTarget)seed);
+            }
+            if(target instanceof Role) {
+                return new SimpleTTNode((TrustTarget)seed);
+            }
+            if(target instanceof LinkedRole) {
+                return new LinkTTNode((TrustTarget)seed);
+            }
+            if(target instanceof Intersection) {
+                return new IntersectionTTNode((TrustTarget)seed);
+            }
+        }
+        if(seed instanceof LinkingGoal) {
+            return new LinkingGoalNode((LinkingGoal)seed);
+        }
+        return null;
+    }
+
+    /** Default constructor. Subclasses should access processing state field */
+    public TTGNode(Goal target) { 
+	goal = target; 
+	processor.addObserver(this);
+    }
+
+
+    /** updates the processing state of this node */
+    public void updateProcessingState(ProcessingState state) {
+        processor.update(state);
+    }
+
+    /** 
+     * This method should be polymorphic since children will have customized
+     * fields.
+     */
+    public void update(Observable obs, Object obj) {
+	if(obs == processor) {
+	    setChanged();
+	    notifyObservers(processor);
+	}
+    }
+
+    /** Polymorphic method for initializing a node based on its context */
+    public void init(NegotiationContext context) {
+	System.out.println("TTGNode: initialize context for " + getGoal());
+	if(context == null) {
+	    System.out.println("WARNING NULL CONTEXT ENCOUNTERED!!!");
+	}
+	this.context = context;
+    }
+
+    /** 
+     * A generic process method to determine whether to process this node
+     * as a verifier or an opponent.
+     * @param context The context of this trust negotiation
+     */
+    public void process(NegotiationContext context) {
+	Entity verifier = getGoal().getVerifier();
+	if(context.getSelf().equals(verifier)) {
+	    // check verifier processed . . .
+	    if(getProcessingState().isVerifierProcessed()) {
+		System.out.println("TTGNode: already verifier processed node "
+				   + getGoal());
+		return;
+	    }
+	    verifierProcess(context);
+	}
+	// check opponent processed . . .
+	else {
+	    if(getProcessingState().isOpponentProcessed()) {
+		System.out.println("TTGNode: already opponent processed node "
+				   + getGoal());
+		return;
+	    }
+	    opponentProcess(context);	    
+	}
+    }
+
+    /** 
+     * Each distinct node type should know how to process itself, so this 
+     * method should be overridden in subclasses. 
+     * @param context A context w/helper functions required for processing
+     */
+    public abstract void verifierProcess(NegotiationContext context);
+
+    /** 
+     * Each distinct node type should know how to process itself, so this 
+     * method should be overridden in subclasses. 
+     * @param context A context w/helper functions required for processing
+     */
+    public abstract void opponentProcess(NegotiationContext context);
+
+    /** Public accessor method for the negotiation context */
+    public NegotiationContext getContext() { return context; }
+
+    /** Accessor/modifier method for  the verifier of the trust target. */
+    public Entity getVerifier() { return goal.getVerifier(); }
+
+    /** Accessor/modifier method for the subject (RHS) of the trust target. */
+    public EntityExpression getSubject() { return goal.getSubject(); }
+
+    /** Accessor method for the processing state of this node */
+    public ProcessingState getProcessingState() { return processor; }
+
+    /** Accessor method for the goal/trust target  of this graph node */
+    public Goal getGoal() { return goal; }
+
+    /** Accessor method for the type of this TTG node */
+    public String getType() { return subName; }
+
+    /** Accessor/modifier method for the target role of the trust target. */
+    //public EntityExpression getTargetExpression() { return goal.getTargetRole();}
+
+    /** Adds a parent node to this instance */
+    public void addParent(TTGNode node) {
+	parents.add(node);
+    }
+
+    /** Adds a child node to this instance. */
+    public void addChild(TTGNode node) {
+	children.add(node);
+    }
+
+    /** accessor for a set of all the child nodes of the current instance */
+    public TTGNodeSet getChildren() { return children; }
+
+    /** accessor for a set of all the parent nodes of the current instance */
+    public TTGNodeSet getParents() { return parents; }
+
+    /** Print out a node in human readable format */
+    public String toString() {
+	StringBuffer buff = new StringBuffer("[");
+	buff.append(getClass().getName()).append(", ");
+	buff.append(processor).append(", ");
+	buff.append(getGoal().toString()).append("]");
+	return buff.toString();
+    }
+
+    /** Polymorphic method for converting a node into an XML string */
+    public abstract String toXML();
+
+    /** Method for children to use for creating a XML compatible string */
+    protected String toXML(String options, String elements) { 
+	StringBuffer buff = new StringBuffer("<");
+	buff.append(subName).append(options).append(">\n");
+	buff.append(getGoal().toXML());
+	buff.append(processor.toXML());
+	buff.append(elements);
+	buff.append("</").append(subName).append(">\n");
+	return buff.toString();
+    }
+
+    /** Friendly debuggin method to be inherited by all children */
+    protected void debug(String key, String message) {
+	StringBuffer buff = new StringBuffer(subName);
+	if(context != null)
+	    buff.append("[").append(context.getSelf()).append("]");
+	buff.append(": ").append(message);
+	Debug.debug(key, buff.toString());
+    }
+
+
+}
+
+
+
+
+
+
+
+
+
+
Index: fedd/abac-src/ttg/trust/TTGNodeSet.java
===================================================================
--- fedd/abac-src/ttg/trust/TTGNodeSet.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/TTGNodeSet.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,54 @@
+package com.nailabs.abac.trust;
+
+import edu.stanford.peer.rbtm.credential.*;
+import java.util.*;
+
+/**
+ * Place holder for sets of nodes. An internal index keeps track of nodes
+ * as new ones are added to the set. Future versions may implement a sorting 
+ * algorithm for nodes. 
+ */
+public class TTGNodeSet extends HashMap {
+    
+    /** index of nodes that have been enqueued for processing */
+    protected LinkedList index = new LinkedList();
+
+    /** add a single trust target graph node to the set */
+    public boolean add(TTGNode node) {
+	boolean isNew = containsValue(node);
+
+	if(node == null) {
+	    System.out.println("Attempting to add null node!!");
+	    return false;
+	}
+	if(isNew) {
+	    System.out.println("Duplicate node in set. " + node.getGoal());
+	    index.add(node);
+	} 
+	put(node.getGoal(), node);
+	return isNew;
+    }
+
+    /** adds a set of nodes to the set */
+    public boolean addAll(TTGNodeSet set) {
+	boolean result = false;
+	Iterator i = set.values().iterator();
+	while(i.hasNext()) {
+	    TTGNode node = (TTGNode)i.next();
+	    result = (result || add(node));
+	}
+	return result;
+    }
+
+    public Object getFirst() {
+	return index.getFirst();
+    }
+
+    public Object getLast() {
+	return index.getLast();
+    }
+}
+
+
+
+
Index: fedd/abac-src/ttg/trust/TargetNode.java
===================================================================
--- fedd/abac-src/ttg/trust/TargetNode.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/TargetNode.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,200 @@
+package com.nailabs.abac.trust;
+
+import com.nailabs.abac.process.*;
+import edu.stanford.peer.rbtm.credential.*;
+import java.util.*;
+
+/**
+ * A target node is the parent class for the <CODE>*TTNode</CODE> classes, 
+ * which have the following common elements: satisfaction state, implication
+ * parents, and control parents.
+ */
+public abstract class TargetNode extends TTGNode 
+    implements SatisfactionListener {
+
+    /** The satisfaction state of this node */
+    protected SatisfactionState satisfier;
+    
+    /**
+     * A set of implication parent nodes. Each parent represents a separate
+     * edge in the trust target graph. 
+     * @see com.nailabs.abac.process.ImplicationEdge
+     */
+    protected TTGNodeSet implicationParents = new TTGNodeSet();
+
+    
+    /**
+     * A set of control parent nodes. Each parent represents a separate edge
+     * in the trust target graph.
+     * @see com.nailabs.abac.process.ControlEdge
+     */
+    protected TTGNodeSet controlParents = new TTGNodeSet();
+    
+    /** Default constructor for a TargetNode */
+    public TargetNode(TrustTarget target) {
+	super(target);
+	subName = "TargetNode";
+	processor = new ProcessingState();
+	satisfier = new SatisfactionState(SatisfactionState.UNKNOWN);
+	satisfier.addObserver(this);
+    }
+    
+    /** Constructor which also creates a trust target implicitly */
+    public TargetNode(Entity verifier, EntityExpression target, Entity subject)
+	throws CredentialParsingException, TrustTargetParsingException 
+    {
+	this(new TrustTarget(verifier, target, subject));
+    }
+
+   /** 
+     * This method should be polymorphic since children will have customized
+     * fields.
+     */
+    public void update(Observable obs, Object obj) {
+	if(obs == satisfier) {
+	    setChanged();
+	    notifyObservers(satisfier);
+	} else {
+	    super.update(obs, obj);
+	}
+    }
+
+
+    /** Read-only accessor method for the satisfaction state. */
+    public int getSatisfactionValue() { 
+	if(satisfier == null) return -1;
+	return satisfier.getState(); 
+    }
+
+    /**
+     * Accessor method for setting the satisfaction state field.
+     * @param state The new satisfaction state.
+     * @return The old satisfaction state.
+     */
+    protected SatisfactionState setState(SatisfactionState state) {
+	SatisfactionState old = satisfier;
+	satisfier = state;
+	debug("satisfaction",
+	      "satisfaction state for " + getGoal() + " = " + state);
+	//if(!satisfier.equals(old)) {
+    setChanged();
+    notifyObservers(state);
+	//}
+	return old;
+    }
+
+    /** 
+     * Process a node whose trust target verifier entity is not self 
+     * @see RMINegotiator
+     */
+    public abstract void opponentProcess(NegotiationContext context);
+
+    /** 
+     * Process a node whose trust target verifier entity is self 
+     * @see RMINegotiator
+     */
+    public abstract void verifierProcess(NegotiationContext context);
+
+    /**
+     * Records the new state and then propagates it to the parent listeners.
+     * @param state The new satisfaction state to be propagated. 
+     */
+    public  TTGNodeSet receive(TrustTarget source, SatisfactionState state) {
+	TTGNodeSet results = new TTGNodeSet();
+	debug("satisfaction", getGoal() + " received " + state + " from " +
+	      source);
+	// if the state has not changed stop propagating it
+	if(!(this instanceof TrivialTTNode)) {
+	    if(satisfier.getState() == state.getState() ||
+	       getGoal().equals(source)) {
+		debug("satisfaction",
+		      "not trivial and received same state bailing out now!");
+		return results;
+	    }
+	}
+	setState(state);
+	//}
+	Iterator i = implicationParents.values().iterator();
+	while(i.hasNext()) {
+	    try { // this will fail if the parent is a linking goal
+		SatisfactionListener listener = (SatisfactionListener)i.next();
+		TTGNodeSet branchResult = listener.receive((TrustTarget)getGoal(), state);
+		if(branchResult == null && branchResult.size() > 0) {
+		    results.addAll(branchResult);
+		}
+	    }
+	    catch(Exception ex) { // to print out exception uncomment
+		ex.printStackTrace();
+	    }
+	}
+ 	//if(state.getState() == SatisfactionState.FAILED) {
+    //bail out for now...
+    //return results;
+    //}
+    // Work with the control parents
+	i = controlParents.values().iterator();
+	Strategy strategy = context.getStrategy();
+    //if satisfied and there exist control parent(s), then notify strategy
+    if(state.getState() == SatisfactionState.SATISFIED) {
+        if(i.hasNext()) {
+            //notify strategy that a control child has been satisfied
+            strategy.addSatisfiedControlChild(this); 
+        }
+        while(i.hasNext()) { //place each control parent on the worklist
+            TTGNode controlParent = (TTGNode)i.next();
+            strategy.addToWorklist(controlParent);
+        }
+	}
+	System.out.println("TargetNode: " + getGoal() + "exiting receive method");
+	return results;
+    }
+
+    /** Add a goal as an implication parent of this node. */
+    public void addImplicationParent(TargetNode parent) {
+        if(parent != null){ 
+            debug("node", "adding implication parent");
+            implicationParents.add(parent);
+            parent.receive((TrustTarget)getGoal(), satisfier);
+        }
+    }
+
+    /** Add a goal as a control parent of this node. */ 
+    public void addControlParent(TargetNode parent) {
+	if(parent != null) { 
+	    controlParents.add(parent);
+	    if(getSatisfactionValue() == SatisfactionState.SATISFIED) {
+		context.getStrategy().addToWorklist(parent);
+	    }
+	    //setChanged();
+	    //notifyObservers();
+	}
+	//receive((TrustTarget)getGoal(), satisfier);
+    }
+
+    /** Convenience accessor method for the target role expression */
+    public EntityExpression getTargetExpression() { 
+	return ((TrustTarget)getGoal()).getTargetRole(); 
+    }
+
+    public String toXML() {
+	return toXML(new String(""));
+    }
+
+    public String toXML(String options) {
+	return toXML(options, satisfier.toXML());
+    }
+
+    /** Print out a node in human readable format */
+    public String toString() {
+	StringBuffer buff = new StringBuffer("[");
+	buff.append(getClass().getName()).append(", ");
+	buff.append(processor).append(", ");
+	buff.append(satisfier).append(", ");
+	buff.append(getGoal().toString()).append("]");
+	return buff.toString();
+    }
+
+}
+
+
+ 
Index: fedd/abac-src/ttg/trust/TrivialTTNode.java
===================================================================
--- fedd/abac-src/ttg/trust/TrivialTTNode.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/TrivialTTNode.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,81 @@
+package com.nailabs.abac.trust;
+
+import edu.stanford.peer.rbtm.credential.*;
+import com.nailabs.abac.process.*;
+
+/** 
+ * A trivial trust target node is a leaf node which propagates satisfaction
+ * state up towards the root of the graph. 
+ */
+public class TrivialTTNode extends TargetNode {
+
+    //NegotiationContext context = null;
+
+    /**
+     * Create a new trivial trust target node. 
+     */
+    public TrivialTTNode(Entity v, Entity subject) 
+	throws CredentialParsingException, TrustTargetParsingException
+    {
+	this(new TrustTarget(v, subject, subject)); // set up trust target
+    }
+
+    /** Create a new trivial TT node base on the supplied trust target */
+    public TrivialTTNode(TrustTarget tt)
+    {
+        super(tt);                  // set up trust target
+        SatisfactionState satisfied = 
+            new SatisfactionState(SatisfactionState.SATISFIED);
+        subName = "TrivialTarget";
+        processor = new ProcessingState(true, true); 
+        // node is fully processed when added into a graph
+        setState(satisfied);
+    }
+
+    //public void init(NegotiationContext context) {
+    //this.context = context;
+    //receive((TrustTarget)getGoal(), 
+    //new SatisfactionState(SatisfactionState.SATISFIED));
+    //}
+
+    /** public accessor method for the entity which is target and subject */
+    public Entity getEntity() { return (Entity)getSubject(); }
+
+    /** process the node by the verifier of this node's trust target */
+    public void verifierProcess(NegotiationContext context) { 
+	process();
+    }
+
+    /** process the node by the opponent of this node's trust target */
+    public void opponentProcess(NegotiationContext context) { 
+	process();
+    }
+
+    public void addImplicationParent(StandardTTNode parent) {
+        setChanged();
+        notifyObservers(new SatisfactionState(SatisfactionState.SATISFIED));
+        super.addImplicationParent(parent);
+    }
+	
+    /**
+     * Propagates satisfied satisfaction state to the parent listeners.
+     * @param state The new satisfaction state to be propagated. 
+     */
+    public  TTGNodeSet receive(TrustTarget src, SatisfactionState state) {
+	return super.receive((TrustTarget)getGoal(), 
+		      new SatisfactionState(SatisfactionState.SATISFIED));
+    }
+    
+    /** Processing is the same for verifier and opponent. */
+    private void process() {
+	//int satisfaction = (getSubject().equals(getTargetExpression()))?
+	//SatisfactionState.SATISFIED: SatisfactionState.FAILED;
+	//receive((TrustTarget)getGoal(), new SatisfactionState(satisfaction));
+    }
+
+}
+
+
+
+
+
Index: fedd/abac-src/ttg/trust/TrustTarget.java
===================================================================
--- fedd/abac-src/ttg/trust/TrustTarget.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/TrustTarget.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,135 @@
+package com.nailabs.abac.trust;
+
+import com.nailabs.abac.process.*;
+import edu.stanford.peer.rbtm.credential.*;
+import java.util.*;
+
+/**
+ * An instance of this class repsent a trust target of the form: <BR>
+ * <CENTER> &lt;V: e &lt;-- S &gt; </CENTER> <BR>
+ * where V is on the negotiators; 
+ * e is a role expression called the target role; and
+ * S is a role expression called the subject role. S is frequently the 
+ * opponent negotiator of V.
+ */
+public class TrustTarget extends Goal {
+
+    /** The target expression of this trust target */
+    protected EntityExpression targetRole;
+
+
+    /** Itemized default constructor */
+    public TrustTarget(Entity v, EntityExpression e, EntityExpression s) 
+	throws TrustTargetParsingException, CredentialParsingException {
+	verifier = v;
+	targetRole = e;
+	subject = s;
+    }
+
+    /** Construct a new trust target from a string */
+    public TrustTarget(String s) 
+	throws TrustTargetParsingException, CredentialParsingException {
+	StringTokenizer st = new StringTokenizer(s, ":<?-");
+	if(st.countTokens() < 3) 
+	    throw new TrustTargetParsingException("Too few elements!", s);
+	verifier = (Entity)	    
+	    StaticCredential.getEntityExpression(st.nextToken().trim());
+	targetRole = 
+	    StaticCredential.getEntityExpression(st.nextToken().trim());
+	subject = 
+	    StaticCredential.getEntityExpression(st.nextToken().trim());
+    }
+
+    /** Unique hash function based on a verifier-target-subject triplet */
+    public int hashCode() {
+	return verifier.hashCode() * 4 + targetRole.hashCode() * 2 + 
+	    subject.hashCode();
+    }
+
+
+    /** accessor method for the target role expressin of this target */
+    public EntityExpression getTargetRole() { return targetRole; }
+
+
+    public String getType() {
+        if(targetRole instanceof Role) {
+            return new String("RoleTarget");
+        }
+        else if(targetRole instanceof LinkedRole) {
+            return new String("LinkedRoleTarget");
+        }
+        else if(targetRole instanceof Intersection) {
+            return new String("IntersectionTarget");
+        }
+        else if(targetRole instanceof Entity) {
+            return new String("TrivialTarget");
+        }
+        return new String("TrustTarget");
+    }
+
+    public ProcessingState getInitialProcessingState(NegotiationContext ctx) {
+        if(targetRole instanceof Entity) { // trivial trust target
+            return new ProcessingState(true, true);
+        }
+        else if(targetRole instanceof Role) { // simple trust target
+            RoleName r = ((Role)targetRole).getName();
+            if(ctx.subjectTracesAll(r))
+                return new ProcessingState(true, false);
+            else
+                return new ProcessingState(false, true);
+        }
+        else if(targetRole instanceof LinkedRole) { // linked role trust target
+            RoleName r1 = ((LinkedRole)targetRole).getFirstRole().getName();
+            RoleName r2 = ((LinkedRole)targetRole).getSecondRoleName();
+            if(ctx.subjectTracesAll(r1) && ctx.subjectTracesAll(r2)) {
+                return new ProcessingState(true, false);
+            }
+            else {
+                return new ProcessingState(false, true);
+            }
+        }
+        else if(targetRole instanceof Intersection) { // intersection TT
+            if(ctx.getSelf().equals(getVerifier())) {
+                return new ProcessingState(false, true);
+            } else {
+                return new ProcessingState(true, false);
+            }
+        }
+        return new ProcessingState();
+    }
+
+    public String toString() {
+	StringBuffer buff = new StringBuffer();
+	buff.append(getVerifier().toString()).append(": ");
+	buff.append(getTargetRole().toString());
+	buff.append(" <<-?- ").append(getSubject().toString());
+	//buff.append("]");
+	return buff.toString();
+    }
+
+    public String toXML() {
+    /*    
+	StringBuffer buff = new StringBuffer("<TrustTarget>\n");
+	buff.append("\t<Verifier>");
+	buff.append(getVerifier().toString());
+	buff.append("</Verifier>\n");
+	buff.append("\t<Target>");
+	buff.append(getTargetRole().toString());
+	buff.append("</Target>\n");
+	buff.append("\t<Subject>");
+	buff.append(getSubject().toString());
+	buff.append("</Subject>\n");
+	buff.append("</TrustTarget>\n");
+	return buff.toString();	
+    */
+        return toString().replaceAll("<","&lt;");
+    }
+}
+
+
+
+
+
+
+
+
Index: fedd/abac-src/ttg/trust/TrustTargetParsingException.java
===================================================================
--- fedd/abac-src/ttg/trust/TrustTargetParsingException.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/TrustTargetParsingException.java	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,20 @@
+package com.nailabs.abac.trust;
+
+/** 
+ * An exception for signaling that a trust target has been incorrectly 
+ * formatted.
+ */
+public class TrustTargetParsingException extends Exception {
+    /** The string containing an improperly formatted trust target */
+    private String data;
+
+    /** Detailed contructor for error and the offending datum */
+    public TrustTargetParsingException(String error, String offender) {
+	super(error);
+	data = offender;
+    }
+
+    /** Accessor method for the data field */
+    public String getData() { return data; }
+
+}
Index: fedd/abac-src/ttg/trust/package.html
===================================================================
--- fedd/abac-src/ttg/trust/package.html	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
+++ fedd/abac-src/ttg/trust/package.html	(revision 8780cbecc6db2bdc2b9ef31eec6e5209ad3bff15)
@@ -0,0 +1,6 @@
+<BODY>
+<P> The trust package contains the trust target graph (TTG) and other classes
+    which can be used to compase the graph. The primary function is to provide
+    data structures for state information of the system.
+</P>
+</BODY>
