summaryrefslogtreecommitdiff
path: root/same/old/SameService.java
diff options
context:
space:
mode:
Diffstat (limited to 'same/old/SameService.java')
-rw-r--r--same/old/SameService.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/same/old/SameService.java b/same/old/SameService.java
new file mode 100644
index 0000000..8f239da
--- /dev/null
+++ b/same/old/SameService.java
@@ -0,0 +1,40 @@
+package com.orbekk.same;
+
+import java.util.Map;
+
+public interface SameService {
+ /**
+ * A notification that 'networkName' exists.
+ *
+ * This is called by any participant of a network after a broadcast
+ * has been performed.
+ */
+ void notifyNetwork(String networkName);
+
+ /**
+ * A request from the callee to participate in 'networkName'.
+ */
+ void participateNetwork(String networkName, String clientId, String url);
+
+ /**
+ * Notification of participation in network.
+ */
+ void notifyParticipation(String networkName, String masterId);
+
+ /**
+ * New state.
+ *
+ * When sent to a non-master from the master, use 'newState' as the
+ * current state.
+ *
+ * When sent to a master, broadcast the new state to all clients.
+ */
+ void setState(String newState);
+
+ /**
+ * Notify all nodes of network participants.
+ *
+ * Only sent from master to non-master.
+ */
+ void setParticipants(Map<String, String> participants);
+}