diff options
Diffstat (limited to 'src/main/java/org/gnunet/testbed/ControllerProc.java')
-rw-r--r-- | src/main/java/org/gnunet/testbed/ControllerProc.java | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/main/java/org/gnunet/testbed/ControllerProc.java b/src/main/java/org/gnunet/testbed/ControllerProc.java index 9eaca2c..69961c7 100644 --- a/src/main/java/org/gnunet/testbed/ControllerProc.java +++ b/src/main/java/org/gnunet/testbed/ControllerProc.java | |||
@@ -13,20 +13,29 @@ import java.util.zip.Deflater; | |||
13 | * the testbed helper on a remote machine. | 13 | * the testbed helper on a remote machine. |
14 | */ | 14 | */ |
15 | public class ControllerProc { | 15 | public class ControllerProc { |
16 | final Helper helper; | 16 | private Helper helper; |
17 | 17 | ||
18 | 18 | ||
19 | public class ControllerProcReceiver extends RunaboutMessageReceiver { | 19 | public class ControllerProcReceiver extends RunaboutMessageReceiver { |
20 | public void visit(HelperReplyMessage m) { | 20 | public void visit(HelperReplyMessage m) { |
21 | System.out.println("got controller proc message"); | ||
21 | 22 | ||
22 | } | 23 | } |
24 | |||
23 | @Override | 25 | @Override |
24 | public void handleError() { | 26 | public void handleError() { |
25 | 27 | throw new AssertionError(); | |
26 | } | 28 | } |
27 | } | 29 | } |
28 | 30 | ||
29 | /** | 31 | /** |
32 | * Create a controller proc. Nothing will hapen until ControllerProc.start is called. | ||
33 | */ | ||
34 | public void ControllerProc() { | ||
35 | |||
36 | } | ||
37 | |||
38 | /** | ||
30 | * Starts a controller process at the given host. The given host's configration | 39 | * Starts a controller process at the given host. The given host's configration |
31 | * is used as a Template configuration to use for the remote controller; the | 40 | * is used as a Template configuration to use for the remote controller; the |
32 | * remote controller will be started with a slightly modified configuration | 41 | * remote controller will be started with a slightly modified configuration |
@@ -47,12 +56,22 @@ public class ControllerProc { | |||
47 | * (synchronous errors will be signalled by returning NULL). This | 56 | * (synchronous errors will be signalled by returning NULL). This |
48 | * parameter cannot be NULL. | 57 | * parameter cannot be NULL. |
49 | */ | 58 | */ |
50 | public ControllerProc(String trustedIP, Host host, ControllerStatusCallback cb) { | 59 | public void start(String trustedIP, Host host, ControllerStatusCallback cb) { |
51 | if (host.isLocal()) { | 60 | if (host.isLocal()) { |
52 | helper = new Helper(false, "gnunet-testbed-helper", null, new ControllerProcReceiver()); | 61 | helper = new Helper(false, "gnunet-helper-testbed", null, new ControllerProcReceiver()); |
53 | } else { | 62 | } else { |
54 | throw new AssertionError("not implemented yet"); | 63 | throw new AssertionError("not implemented yet"); |
55 | } | 64 | } |
65 | helper.send(makeHelperInitMessage(trustedIP, host)); | ||
66 | } | ||
67 | |||
68 | /** | ||
69 | * Stop the controller process (also will terminate all peers and controllers | ||
70 | * dependent on this controller). This function blocks until the testbed has | ||
71 | * been fully terminated (!). The controller status cb will not be called. | ||
72 | */ | ||
73 | public void stop() { | ||
74 | throw new AssertionError("not implemented"); | ||
56 | } | 75 | } |
57 | 76 | ||
58 | 77 | ||