01: package hero.client.samples;
02:
03: import hero.client.test.SimpleCallbackHandler;
04: import hero.interfaces.Constants;
05: import hero.interfaces.ProjectSession;
06: import hero.interfaces.ProjectSessionHome;
07: import hero.interfaces.ProjectSessionUtil;
08:
09: import javax.security.auth.login.LoginContext;
10:
11: public class RemovePerformerAssignment {
12: static public void main(String[] args) throws Exception {
13: // Admin login
14: char[] password = { 't', 'o', 't', 'o' };
15: SimpleCallbackHandler handler = new SimpleCallbackHandler(
16: "admin", password);
17: LoginContext lc = new LoginContext("TestClient", handler);
18: lc.login();
19:
20: ProjectSessionHome projectSessionh = ProjectSessionUtil
21: .getHome();
22: ProjectSession pss = projectSessionh.create();
23: pss.initModel("PerformerAssignment");
24: pss.setProperty("prop1", "value1");
25:
26: pss.addNode("node1", Constants.Nd.AND_JOIN_NODE);
27: pss.setNodeRole("node1", "admin");
28: pss.addNode("node2", Constants.Nd.AND_JOIN_NODE);
29: pss.addEdge("node1", "node2");
30: pss.addNodePerformerAssign("node2", "myPerformer",
31: Constants.PerformerAssigment.PROPERTIES, "prop1");
32:
33: pss.removeNodePerformerAssign("node2");
34:
35: }
36: }
|