package com.nailabs.abac.process; import com.nailabs.abac.trust.*; import com.nailabs.abac.test.*; import java.util.*; /** * A linking soilution edge represents an edge in a trust target graph * between a LinkingGoalNode and it's solution children. */ public class LinkingSolutionEdge extends EdgeOperation { /** Default constructor */ public LinkingSolutionEdge() { super(); type = new String("LinkingSolution"); } /** Parsed element constructor */ public LinkingSolutionEdge(LinkingGoal parent, TrustTarget child, ProcessingState state) { super(parent, child, state, null); type = "LinkingSolution"; } public void performAdditional(TTG graph) { SimpleTTNode child = (SimpleTTNode)graph.getNodeByHash(getChild()); LinkingGoalNode parent = (LinkingGoalNode)graph.getNodeByHash(getParent()); parent.addChild(child); child.addLinkingSolutionParent(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); } }