public interface Gateway
Modifier and Type | Method and Description |
---|---|
void |
connect()
Attempts to establish a connection to the remote site.
|
void |
disconnect(boolean dueToError)
Drops the established connection.
|
String |
getId()
Gets gateway id (hostname, port, ...)
|
long |
getLastReceivedMsgTimestamp()
Gets last timestamp in unix millis when the last msg was received
|
boolean |
isConnected()
Gets a value specifying whether the connection to the remote site is established.
|
void |
sendData(byte[] data)
Sends data through the current
Gateway . |
void |
setListener(GatewayListener listener)
Sets the
GatewayListener used to observe the current Gateway implementation. |
void setListener(GatewayListener listener)
GatewayListener
used to observe the current Gateway
implementation.listener
- the GatewayListener
used to observe the current Gateway
implementation or a null reference if observation is not required.void sendData(byte[] data) throws IOException
Gateway
.data
- data to send.IllegalArgumentException
- The data
is a null reference or an empty arrayIOException
void connect() throws IOException
IOException
- There was an error establishing the connection.void disconnect(boolean dueToError)
dueToError
- - when false user wished to close connection; when true there was a problem and we had
to close itboolean isConnected()
long getLastReceivedMsgTimestamp()
String getId()
Copyright © 2013–2023. All rights reserved.