package com.nailabs.abac.process;
import com.nailabs.abac.trust.*;
import com.nailabs.abac.test.*;
import java.util.*;
/**
* A linking implication edge represents an edge in a trust target graph
* between a LinkTTNode
and a LinkingGoalNode
*/
public class LinkingMonitorEdge extends EdgeOperation {
/** Default constructor (used for TNT integration).*/
public LinkingMonitorEdge() {
super();
type = new String("LinkingMonitor");
}
/** Parsed element constructor */
public LinkingMonitorEdge(TrustTarget parent, LinkingGoal child,
ProcessingState state) {
super(parent, child, state, null);
type = "LinkingMonitor";
}
public void performAdditional(TTG graph) {
LinkTTNode parent = (LinkTTNode)graph.getNodeByHash(getParent());
LinkingGoalNode child =
(LinkingGoalNode)graph.getNodeByHash(getChild());
parent.addChild(child);
child.addParent(parent);
}
public void performNewAdditional(TTG graph) {
LinkingGoalNode child =
(LinkingGoalNode)graph.getNodeByHash(getChild());
if(child == null) {
child = (LinkingGoalNode)TTGNode.createNode(getChild());
child.getProcessingState().update(state);
graph.putNodeByHash(child);
}
performAdditional(graph);
}
}