Class WebsocketIOClient<T>
java.lang.Object
org.openremote.agent.protocol.io.AbstractNettyIOClient<T,InetSocketAddress>
org.openremote.agent.protocol.websocket.WebsocketIOClient<T>
- All Implemented Interfaces:
IOClient<T>
,NettyIOClient<T>
This is an
IOClient
implementation based on AbstractNettyIOClient
.
For custom decoders, the initial message type is of type String
.
For custom encoders, the final message type must be of type String
.-
Nested Class Summary
Nested classes/interfaces inherited from class org.openremote.agent.protocol.io.AbstractNettyIOClient
AbstractNettyIOClient.ByteToMessageDecoder<T>, AbstractNettyIOClient.MessageToByteEncoder<T>, AbstractNettyIOClient.MessageToMessageDecoder<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static org.jboss.resteasy.client.jaxrs.ResteasyClient
protected io.netty.handler.codec.http.websocketx.WebSocketClientProtocolHandler
protected CompletableFuture
<Void> protected String
protected org.openremote.model.auth.OAuthGrant
static final long
static final long
protected boolean
protected ScheduledFuture
<?> protected int
protected static io.netty.handler.ssl.SslContext
protected URI
protected boolean
Fields inherited from class org.openremote.agent.protocol.io.AbstractNettyIOClient
bootstrap, channel, connectionStatus, connectionStatusConsumers, connectRetry, connectTimeout, encoderDecoderProvider, executorService, messageConsumers, RECONNECT_DELAY_INITIAL_MILLIS, RECONNECT_DELAY_MAX_MILLIS, scheduledExecutorService, workerGroup
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addEncodersDecoders
(io.netty.channel.Channel channel) protected void
protected Class
<? extends io.netty.channel.Channel> protected org.jboss.resteasy.client.jaxrs.ResteasyClient
Should return a URI that uniquely identifies this client instanceprotected io.netty.handler.ssl.SslContext
protected io.netty.channel.EventLoopGroup
protected void
Start the actual connection and return a future indicating completion state.Methods inherited from class org.openremote.agent.protocol.io.AbstractNettyIOClient
addConnectionStatusConsumer, addMessageConsumer, configureChannel, connect, disconnect, doConnect, doReconnect, getConnectionStatus, getConnectTimeoutMillis, initChannel, onConnectionStatusChanged, onDecodeException, onEncodeException, onMessageReceived, removeAllConnectionStatusConsumers, removeAllMessageConsumers, removeConnectionStatusConsumer, removeMessageConsumer, scheduleDoConnect, sendMessage, setConnectTimeoutMillis, setEncoderDecoderProvider, toCompletableFuture, toString, waitForConnectFuture
-
Field Details
-
client
protected static org.jboss.resteasy.client.jaxrs.ResteasyClient client -
PING_MILLIS
public static final long PING_MILLIS- See Also:
-
PING_TIMEOUT_MILLIS
public static final long PING_TIMEOUT_MILLIS- See Also:
-
pingFuture
-
useSsl
protected boolean useSsl -
uri
-
sslCtx
protected static io.netty.handler.ssl.SslContext sslCtx -
handler
protected io.netty.handler.codec.http.websocketx.WebSocketClientProtocolHandler handler -
headers
-
oAuthGrant
protected org.openremote.model.auth.OAuthGrant oAuthGrant -
host
-
port
protected int port -
pingDisabled
protected boolean pingDisabled -
handshakeFuture
-
-
Constructor Details
-
WebsocketIOClient
-
WebsocketIOClient
-
-
Method Details
-
getClient
protected org.jboss.resteasy.client.jaxrs.ResteasyClient getClient() -
getChannelClass
- Specified by:
getChannelClass
in classAbstractNettyIOClient<T,
InetSocketAddress>
-
getClientUri
Description copied from interface:IOClient
Should return a URI that uniquely identifies this client instance -
getWorkerGroup
protected io.netty.channel.EventLoopGroup getWorkerGroup()- Specified by:
getWorkerGroup
in classAbstractNettyIOClient<T,
InetSocketAddress>
-
startChannel
Description copied from class:AbstractNettyIOClient
Start the actual connection and return a future indicating completion state. Implementors can also add any custom connection logic they require.- Specified by:
startChannel
in classAbstractNettyIOClient<T,
InetSocketAddress>
-
addEncodersDecoders
- Overrides:
addEncodersDecoders
in classAbstractNettyIOClient<T,
InetSocketAddress> - Throws:
Exception
-
onHandshakeDone
protected void onHandshakeDone() -
getSSLContext
- Throws:
SSLException
-
doDisconnect
protected void doDisconnect()- Overrides:
doDisconnect
in classAbstractNettyIOClient<T,
InetSocketAddress>
-
getAuthHeader
- Throws:
Exception
-