public class BlaubotServerConnector
extends java.lang.Object
Constructor and Description |
---|
BlaubotServerConnector(java.lang.String serverUniqueDeviceId,
IBlaubotBeaconStore beaconStore,
java.util.List<IBlaubotConnector> connectors) |
Modifier and Type | Method and Description |
---|---|
void |
activateServerConnector()
Activates the connector.
|
void |
deactivateServerConnector()
Deactivates the connector and the connectivity polling.
|
boolean |
getDoConnect() |
IBlaubotConnection |
getServerConnection()
Returns the connection to the server, if available
|
java.lang.String |
getServerUniqueDeviceId()
The configured server's unique device id
|
boolean |
isConnected()
Indicates whether a connection to the server is available or not.
|
static void |
main(java.lang.String[] args) |
void |
setDoConnect(boolean doConnect)
This is the switch which activates or deactivates the server connection.
|
void |
setIncomingConnectionListener(IBlaubotIncomingConnectionListener incomingConnectionListener)
Sets the incoming connection listener which is called if a connection to the server was established.
|
java.lang.String |
toString() |
public BlaubotServerConnector(java.lang.String serverUniqueDeviceId, IBlaubotBeaconStore beaconStore, java.util.List<IBlaubotConnector> connectors)
serverUniqueDeviceId
- the server's static unqiueDevice idbeaconStore
- the beacon store to be used. Should already contain connection meta data to conncet to serverUniqueDeviceIdconnectors
- the list of connectors to be used to establish a connection to the server devicepublic java.lang.String getServerUniqueDeviceId()
public boolean isConnected()
public IBlaubotConnection getServerConnection()
public void activateServerConnector()
public void deactivateServerConnector()
public void setIncomingConnectionListener(IBlaubotIncomingConnectionListener incomingConnectionListener)
incomingConnectionListener
- the listener to be setpublic java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
public void setDoConnect(boolean doConnect)
doConnect
- true if the connector should connect, false if not.public boolean getDoConnect()