Package org.openremote.agent.protocol.io
Interface IOClient<T>
- Type Parameters:
T
- Defines the message type that the instance will encode/decode
- All Known Subinterfaces:
NettyIOClient<T>
- All Known Implementing Classes:
AbstractMQTT_IOClient
,AbstractNettyIOClient
,MQTT_IOClient
,SerialIOClient
,TCPIOClient
,UDPIOClient
,WebsocketIOClient
,ZWaveSerialIOClient
public interface IOClient<T>
Represents an IO client that communicates with a server
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addConnectionStatusConsumer
(Consumer<org.openremote.model.asset.agent.ConnectionStatus> connectionStatusConsumer) Add a consumer of connection statusvoid
addMessageConsumer
(Consumer<T> messageConsumer) Add a consumer of received messagesvoid
connect()
Connect to the devicevoid
Disconnect from the deviceShould return a URI that uniquely identifies this client instanceorg.openremote.model.asset.agent.ConnectionStatus
Get current connection statusvoid
Remove every consumer of connection statusvoid
Remove every consumer of received messagesvoid
removeConnectionStatusConsumer
(Consumer<org.openremote.model.asset.agent.ConnectionStatus> connectionStatusConsumer) Remove a consumer of connection statusvoid
removeMessageConsumer
(Consumer<T> messageConsumer) Remove a consumer of received messagesvoid
sendMessage
(T message) Send a message over the wire
-
Method Details
-
sendMessage
Send a message over the wire -
addMessageConsumer
Add a consumer of received messages -
removeMessageConsumer
Remove a consumer of received messages -
removeAllMessageConsumers
void removeAllMessageConsumers()Remove every consumer of received messages -
addConnectionStatusConsumer
void addConnectionStatusConsumer(Consumer<org.openremote.model.asset.agent.ConnectionStatus> connectionStatusConsumer) Add a consumer of connection status -
removeConnectionStatusConsumer
void removeConnectionStatusConsumer(Consumer<org.openremote.model.asset.agent.ConnectionStatus> connectionStatusConsumer) Remove a consumer of connection status -
removeAllConnectionStatusConsumers
void removeAllConnectionStatusConsumers()Remove every consumer of connection status -
getConnectionStatus
org.openremote.model.asset.agent.ConnectionStatus getConnectionStatus()Get current connection status -
connect
void connect()Connect to the device -
disconnect
void disconnect()Disconnect from the device -
getClientUri
String getClientUri()Should return a URI that uniquely identifies this client instance
-