package com.nailabs.abac.process; import com.nailabs.abac.trust.*; import com.nailabs.abac.test.*; public class IntersectionEdge extends EdgeOperation { /** Jared: Added this method to make XML processing easier */ public IntersectionEdge() { super(); type = new String("Intersection"); } public IntersectionEdge(Goal parent, Goal child, ProcessingState state) { super(parent, child, state, null); //TBD: add extra type checking--verify child is a part of the and-ing type = new String("Intersection"); Debug.debug("intersection", toString()); } public void performAdditional(TTG graph) { IntersectionTTNode parent = (IntersectionTTNode)graph.getNodeByHash(getParent()); TargetNode child = (TargetNode)graph.getNodeByHash(getChild()); parent.addIntersectionChild(child); child.addImplicationParent(parent); } public void performNewAdditional(TTG graph) { TargetNode child = (TargetNode)graph.getNodeByHash(getChild()); if(child == null) { Debug.debug("intersection", "child = " + child); child = (TargetNode)TTGNode.createNode(getChild()); child.getProcessingState().update(state); graph.putNodeByHash(child); } performAdditional(graph); } public String toString() { StringBuffer buff = new StringBuffer("["); buff.append(type).append("Edge "); buff.append(getParent()).append(" <<=== "); buff.append(getChild()).append(", state = "); buff.append(state).append("]"); return buff.toString(); } }