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 ClassesModifier and TypeClassDescriptionprotected classExtracts the text from theWebSocketFrameand sends it to the next handler in the pipelineNested 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 Stringprotected CompletableFuture<Boolean>protected WebsocketIOClient<T>.WebSocketClientHandlerprotected Stringprotected org.openremote.model.auth.OAuthGrantprotected intprotected io.netty.handler.ssl.SslContextprotected URIprotected booleanFields inherited from class org.openremote.agent.protocol.io.AbstractNettyIOClient
bootstrap, channel, channelStartFuture, connectionStatus, connectionStatusConsumers, connectRetry, encoderDecoderProvider, executorService, messageConsumers, permanentError, RECONNECT_DELAY_INITIAL_MILLIS, RECONNECT_DELAY_MAX_MILLIS, workerGroup -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddEncodersDecoders(io.netty.channel.Channel channel) protected CompletableFuture<Boolean>protected Class<? extends io.netty.channel.Channel>Should return a URI that uniquely identifies this client instanceprotected io.netty.channel.EventLoopGroupprotected voidinitChannel(io.netty.channel.Channel channel) Inserts the decoders and encoders into the channel pipelineprotected voidonHandshakeComplete(io.netty.channel.ChannelFuture handshakeFuture) protected io.netty.channel.ChannelFutureMethods inherited from class org.openremote.agent.protocol.io.AbstractNettyIOClient
addConnectionStatusConsumer, addMessageConsumer, configureChannel, connect, disconnect, doDisconnect, getConnectionStatus, onConnectedFutureComplete, onConnectionStatusChanged, onDecodeException, onEncodeException, onMessageReceived, removeAllConnectionStatusConsumers, removeAllMessageConsumers, removeConnectionStatusConsumer, removeMessageConsumer, scheduleDoConnect, sendMessage, setEncoderDecoderProvider, setPermanentError, toString
-
Field Details
-
useSsl
protected boolean useSsl -
uri
-
sslCtx
protected io.netty.handler.ssl.SslContext sslCtx -
handler
-
headers
-
oAuthGrant
protected org.openremote.model.auth.OAuthGrant oAuthGrant -
authHeaderValue
-
host
-
port
protected int port -
connectedFuture
-
-
Constructor Details
-
WebsocketIOClient
-
-
Method Details
-
getChannelClass
- Specified by:
getChannelClassin classAbstractNettyIOClient<T,InetSocketAddress>
-
getClientUri
Description copied from interface:IOClientShould return a URI that uniquely identifies this client instance -
getWorkerGroup
protected io.netty.channel.EventLoopGroup getWorkerGroup()- Specified by:
getWorkerGroupin classAbstractNettyIOClient<T,InetSocketAddress>
-
startChannel
protected io.netty.channel.ChannelFuture startChannel()- Specified by:
startChannelin classAbstractNettyIOClient<T,InetSocketAddress>
-
initChannel
protected void initChannel(io.netty.channel.Channel channel) Description copied from class:AbstractNettyIOClientInserts the decoders and encoders into the channel pipeline- Overrides:
initChannelin classAbstractNettyIOClient<T,InetSocketAddress>
-
onHandshakeComplete
protected void onHandshakeComplete(io.netty.channel.ChannelFuture handshakeFuture) -
addEncodersDecoders
protected void addEncodersDecoders(io.netty.channel.Channel channel) - Overrides:
addEncodersDecodersin classAbstractNettyIOClient<T,InetSocketAddress>
-
doConnect
- Overrides:
doConnectin classAbstractNettyIOClient<T,InetSocketAddress>
-
createConnectedFuture
- Overrides:
createConnectedFuturein classAbstractNettyIOClient<T,InetSocketAddress>
-