public class ServerConnectionManager extends LifecycleListenerAdapter
| Modifier and Type | Class and Description | 
|---|---|
class  | 
ServerConnectionManager.BlaubotServerRelayConnection
A relay connection is a connection that uses admin messages to transport bytes from
 A to C using an intermediate participant B (mediator). 
 | 
| Constructor and Description | 
|---|
ServerConnectionManager(BlaubotChannelManager channelManager,
                       IBlaubotDevice ownDevice,
                       BlaubotConnectionManager mainBlaubotConnectionManager)  | 
| Modifier and Type | Method and Description | 
|---|---|
java.util.List<IBlaubotConnection> | 
getConnectionsToServer()  | 
BlaubotKingdomConnection | 
getCurrentlyUsedServerConnection()  | 
BlaubotServerConnector | 
getServerConnector()  | 
void | 
onConnected()
Triggered when the  
Blaubot instance becomes part of a blaubot kingdom. | 
void | 
onDeviceLeft(IBlaubotDevice blaubotDevice)
Triggered when an  
IBlaubotDevice left the blaubot kingdom. | 
void | 
onDisconnected()
Triggered when the  
Blaubot instance is no longer part of a blaubot kingdom. | 
void | 
onKingDeviceChanged(IBlaubotDevice oldKing,
                   IBlaubotDevice newKing)
Triggered when the king device was changed. 
 | 
void | 
setMaster(boolean isMaster)
Sets whether this manager operates in master mode or not 
 | 
void | 
setServerConnector(BlaubotServerConnector serverConnector)
sets the server connector 
 | 
onDeviceJoined, onPrinceDeviceChangedpublic ServerConnectionManager(BlaubotChannelManager channelManager, IBlaubotDevice ownDevice, BlaubotConnectionManager mainBlaubotConnectionManager)
channelManager - the main blaubot channel managerownDevice - our own devicemainBlaubotConnectionManager - the main blaubot connection manager used by the blaubot instance itselfpublic void setServerConnector(BlaubotServerConnector serverConnector)
serverConnector - the connectorpublic BlaubotServerConnector getServerConnector()
public void onConnected()
ILifecycleListenerBlaubot instance becomes part of a blaubot kingdom.onConnected in interface ILifecycleListeneronConnected in class LifecycleListenerAdapterpublic void onDisconnected()
ILifecycleListenerBlaubot instance is no longer part of a blaubot kingdom.onDisconnected in interface ILifecycleListeneronDisconnected in class LifecycleListenerAdapterpublic void onDeviceLeft(IBlaubotDevice blaubotDevice)
ILifecycleListenerIBlaubotDevice left the blaubot kingdom.onDeviceLeft in interface ILifecycleListeneronDeviceLeft in class LifecycleListenerAdapterblaubotDevice - the device that just leftpublic void onKingDeviceChanged(IBlaubotDevice oldKing, IBlaubotDevice newKing)
ILifecycleListeneronKingDeviceChanged in interface ILifecycleListeneronKingDeviceChanged in class LifecycleListenerAdapteroldKing - the old kingnewKing - the new kingpublic void setMaster(boolean isMaster)
isMaster - true iff operating as masterpublic BlaubotKingdomConnection getCurrentlyUsedServerConnection()
public java.util.List<IBlaubotConnection> getConnectionsToServer()