Class WebSocketTransport
java.lang.Object
org.apache.qpid.protonj2.client.transport.netty4.TcpTransport
org.apache.qpid.protonj2.client.transport.netty4.WebSocketTransport
- All Implemented Interfaces:
- Transport
Netty based WebSockets Transport that wraps and extends the TCP Transport.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.apache.qpid.protonj2.client.transport.netty4.TcpTransportTcpTransport.NettyDefaultHandler<E>, TcpTransport.NettyTcpTransportHandler
- 
Field SummaryFields inherited from class org.apache.qpid.protonj2.client.transport.netty4.TcpTransportbootstrap, channel, closed, connected, connectedLatch, failureCause, host, listener, nettyAllocator, options, port, sslOptions
- 
Constructor SummaryConstructorsConstructorDescriptionWebSocketTransport(io.netty.bootstrap.Bootstrap bootstrap, TransportOptions options, SslOptions sslOptions) Create a newWebSocketTransportinstance with the given configuration.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaddAdditionalHandlers(io.netty.channel.ChannelPipeline pipeline) protected io.netty.channel.ChannelInboundHandlerAdapterReturns a URI that contains some meaningful information about the remote connection such as a scheme that reflects the transport type and the remote host and port that the connection was instructed to connect to.protected Stringprotected voidhandleConnected(io.netty.channel.Channel channel) write(ProtonBuffer output, Runnable onComplete) Writes a chunk of data over the Transport connection without performing an explicit flush on the transport.writeAndFlush(ProtonBuffer output, Runnable onComplete) Writes a chunk of data over the Transport connection and requests a flush of all pending queued write operationsMethods inherited from class org.apache.qpid.protonj2.client.transport.netty4.TcpTransportawaitConnect, checkConnected, close, connect, flush, getBufferAllocator, getHost, getLocalPrincipal, getPort, getSslOptions, getTransportListener, getTransportOptions, handleTransportFailure, isConnected, isSecure, toOutputBuffer, write, writeAndFlush
- 
Constructor Details- 
WebSocketTransportpublic WebSocketTransport(io.netty.bootstrap.Bootstrap bootstrap, TransportOptions options, SslOptions sslOptions) Create a newWebSocketTransportinstance with the given configuration.- Parameters:
- bootstrap- the- Bootstrapthat this transport's IO is bound to.
- options- the- TransportOptionsused to configure the socket connection.
- sslOptions- the- SslOptionsto use if the options indicate SSL is enabled.
 
 
- 
- 
Method Details- 
writeDescription copied from interface:TransportWrites a chunk of data over the Transport connection without performing an explicit flush on the transport. This method allows for a completion callback that is signaled when the actual low level IO operation is completed which could be after this method has returned.- Specified by:
- writein interface- Transport
- Overrides:
- writein class- TcpTransport
- Parameters:
- output- The buffer of data that is to be transmitted.
- onComplete- A- Runnablethat is invoked when the IO operation completes successfully.
- Returns:
- this Transportinstance.
- Throws:
- IOException- if an error occurs during the write operation.
 
- 
writeAndFlushpublic WebSocketTransport writeAndFlush(ProtonBuffer output, Runnable onComplete) throws IOException Description copied from interface:TransportWrites a chunk of data over the Transport connection and requests a flush of all pending queued write operations- Specified by:
- writeAndFlushin interface- Transport
- Overrides:
- writeAndFlushin class- TcpTransport
- Parameters:
- output- The buffer of data that is to be transmitted.
- onComplete- A- Runnablethat is invoked when the IO operation completes successfully.
- Returns:
- this Transportinstance.
- Throws:
- IOException- if an error occurs during the write operation.
 
- 
getRemoteURIDescription copied from interface:TransportReturns a URI that contains some meaningful information about the remote connection such as a scheme that reflects the transport type and the remote host and port that the connection was instructed to connect to. If called before theTransport.connect(String, int, TransportListener)method this method returnsnull.- Specified by:
- getRemoteURIin interface- Transport
- Overrides:
- getRemoteURIin class- TcpTransport
- Returns:
- a URI that reflects a meaningful view of the Transportremote connection details.
 
- 
createChannelHandlerprotected io.netty.channel.ChannelInboundHandlerAdapter createChannelHandler()- Overrides:
- createChannelHandlerin class- TcpTransport
 
- 
addAdditionalHandlersprotected void addAdditionalHandlers(io.netty.channel.ChannelPipeline pipeline) - Overrides:
- addAdditionalHandlersin class- TcpTransport
 
- 
handleConnected- Overrides:
- handleConnectedin class- TcpTransport
- Throws:
- Exception
 
- 
getScheme- Overrides:
- getSchemein class- TcpTransport
 
 
-