source: fedd/abac-src/ttg/process/ControlEdge.java @ 181cf9c

axis_examplecompt_changesinfo-opsversion-2.00version-3.01version-3.02
Last change on this file since 181cf9c was 8780cbec, checked in by Jay Jacobs <Jay.Jacobs@…>, 15 years ago

ABAC sources from Cobham

  • Property mode set to 100644
File size: 1.4 KB
Line 
1package com.nailabs.abac.process;
2
3import com.nailabs.abac.trust.*;
4import edu.stanford.peer.rbtm.credential.*;
5import java.util.*;
6
7/**
8 * A control edge represents an edge in a trust target graph (<CODE>TTG</CODE>)
9 * with the required roles to support this edge.
10 */
11public class ControlEdge extends EdgeOperation {
12    /** Jared: Added this method to make XML processing easier */
13    public ControlEdge() {
14        super();
15        type = "Control";
16    }
17   
18    public ControlEdge(Goal parent, Goal child, ProcessingState state) {
19        super(parent, child, state, null);
20        type = "Control";
21    }
22   
23    public void performAdditional(TTG graph) {
24        SimpleTTNode parent = (SimpleTTNode)graph.getNodeByHash(getParent());
25        TargetNode child = (TargetNode)graph.getNodeByHash(getChild());
26
27        parent.addControlChild(child);
28        child.addControlParent(parent);
29    }
30   
31    public void performNewAdditional(TTG graph) {
32        TargetNode child = (TargetNode)graph.getNodeByHash(getChild());
33        if(child == null) {
34            child = (TargetNode)TTGNode.createNode(getChild());
35            child.getProcessingState().update(state);
36            graph.putNodeByHash(child);
37        }
38        performAdditional(graph); 
39    }
40
41    public String toString() {
42        StringBuffer buff = new StringBuffer("[ControlEdge  ");
43        buff.append(getParent()).append(" <<=== ");
44        buff.append(getChild()).append(", state = ");
45        buff.append(state).append("]");
46        return buff.toString();
47    }
48}
Note: See TracBrowser for help on using the repository browser.