summaryrefslogtreecommitdiff
path: root/same/old/SameService.java
blob: 8f239da53451c0346d1d0157d1b9a22ad4a4e433 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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);
}