package com.nailabs.abac.process; import com.nailabs.abac.trust.*; import edu.stanford.peer.rbtm.credential.*; import java.util.*; /** * A control edge represents an edge in a trust target graph (TTG) * with the required roles to support this edge. */ public class ControlEdge extends EdgeOperation { /** Jared: Added this method to make XML processing easier */ public ControlEdge() { super(); type = "Control"; } public ControlEdge(Goal parent, Goal child, ProcessingState state) { super(parent, child, state, null); type = "Control"; } public void performAdditional(TTG graph) { SimpleTTNode parent = (SimpleTTNode)graph.getNodeByHash(getParent()); TargetNode child = (TargetNode)graph.getNodeByHash(getChild()); parent.addControlChild(child); child.addControlParent(parent); } public void performNewAdditional(TTG graph) { TargetNode child = (TargetNode)graph.getNodeByHash(getChild()); if(child == null) { child = (TargetNode)TTGNode.createNode(getChild()); child.getProcessingState().update(state); graph.putNodeByHash(child); } performAdditional(graph); } public String toString() { StringBuffer buff = new StringBuffer("[ControlEdge "); buff.append(getParent()).append(" <<=== "); buff.append(getChild()).append(", state = "); buff.append(state).append("]"); return buff.toString(); } }