public class DistributedRelay extends Object implements GCMMessageHandler
| Constructor and Description |
|---|
DistributedRelay(Peer peer,
RelayRPC relayRPC,
ConnectionConfiguration config,
RelayConfig relayConfig) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRelayListener(RelayListener relayListener) |
void |
onGCMMessageArrival(String peerId)
Call this when a GCM message arrives
|
RelayConfig |
relayConfig() |
List<BaseRelayConnection> |
relays()
Returns connections to current relay peers
|
FutureRelay |
setupRelays(FutureRelay futureRelay)
Sets up relay connections to other peers.
|
FutureForkJoin<FutureDone<Void>> |
shutdown() |
public DistributedRelay(Peer peer, RelayRPC relayRPC, ConnectionConfiguration config, RelayConfig relayConfig)
peer - the unreachable peerrelayRPC - the relay RPCmaxFail - relayConfig - maxRelays - maximum number of relay peers to set uprelayType - the kind of the relay connectionpublic RelayConfig relayConfig()
public List<BaseRelayConnection> relays()
public void addRelayListener(RelayListener relayListener)
public FutureForkJoin<FutureDone<Void>> shutdown()
public FutureRelay setupRelays(FutureRelay futureRelay)
PeerAddress#MAX_RELAYS or passed to the
constructor of this class. It is important that we call this after we
bootstrapped and have recent information in our peer map.DistributedRelay instancepublic void onGCMMessageArrival(String peerId)
GCMMessageHandleronGCMMessageArrival in interface GCMMessageHandlerpeerId - the collapse key of the GCM message is the same as the relay's peer idCopyright © 2014. All rights reserved.