public class BlaubotWebsocketAdapter extends java.lang.Object implements IBlaubotAdapter
Modifier and Type | Field and Description |
---|---|
static int |
MAX_WEBSOCKET_FRAME_SIZE
The max allowable websocket frame size.
|
static java.lang.String |
URI_PARAM_UNIQUEDEVICEID
The request parameter name for the unique device id when connecting to WEBSOCKET_PATH
|
static java.lang.String |
WEBSOCKET_PATH
The path for the web socket handshake
|
Constructor and Description |
---|
BlaubotWebsocketAdapter(IBlaubotDevice ownDevice,
java.lang.String hostAddress,
int acceptorPort) |
Modifier and Type | Method and Description |
---|---|
Blaubot |
getBlaubot()
Get the current blaubot instance
|
BlaubotAdapterConfig |
getBlaubotAdapterConfig()
Configuration object for hardware specific adapter settings.
|
IBlaubotConnectionAcceptor |
getConnectionAcceptor()
Get the connection acceptor that is in charge to retrieve incoming connections issued by compatible
IBlaubotConnector implementations.
|
ConnectionStateMachineConfig |
getConnectionStateMachineConfig()
The adapter specific
ConnectionStateMachine configuration. |
IBlaubotConnector |
getConnector()
Get the connector for this adapter.
|
static void |
main(java.lang.String[] args) |
void |
setBlaubot(Blaubot blaubotInstance)
Setter for dependency injection of the blaubot instance.
|
public static final java.lang.String WEBSOCKET_PATH
public static final int MAX_WEBSOCKET_FRAME_SIZE
public static final java.lang.String URI_PARAM_UNIQUEDEVICEID
public BlaubotWebsocketAdapter(IBlaubotDevice ownDevice, java.lang.String hostAddress, int acceptorPort)
ownDevice
- our own devicehostAddress
- the own host address (interfaces to bind to)acceptorPort
- the acceptor port to use (to open the websocket server on)public IBlaubotConnector getConnector()
IBlaubotAdapter
getConnector
in interface IBlaubotAdapter
public IBlaubotConnectionAcceptor getConnectionAcceptor()
IBlaubotAdapter
getConnectionAcceptor
in interface IBlaubotAdapter
public void setBlaubot(Blaubot blaubotInstance)
IBlaubotAdapter
setBlaubot
in interface IBlaubotAdapter
blaubotInstance
- the blaubot instancepublic Blaubot getBlaubot()
IBlaubotAdapter
getBlaubot
in interface IBlaubotAdapter
public ConnectionStateMachineConfig getConnectionStateMachineConfig()
IBlaubotAdapter
ConnectionStateMachine
configuration.getConnectionStateMachineConfig
in interface IBlaubotAdapter
public BlaubotAdapterConfig getBlaubotAdapterConfig()
IBlaubotAdapter
getBlaubotAdapterConfig
in interface IBlaubotAdapter
public static void main(java.lang.String[] args)