Interface Transport
- All Known Implementing Classes:
- TcpTransport,- TcpTransport,- WebSocketTransport,- WebSocketTransport
public interface Transport
Base class for all QpidJMS Transport instances.
- 
Method SummaryModifier and TypeMethodDescriptionvoidWaits interruptibly for theTransportto connect to the remote that was indicated in theconnect(String, int, TransportListener)call.voidclose()Close the Transport, no additional send operations are accepted.connect(String host, int port, TransportListener listener) Performs the connect operation for the implemented Transport type such as a TCP socket connection, SSL/TLS handshake etc.flush()Request a flush of all pending writes to the underlying connection.Gets a buffer allocator that can produceProtonBufferinstance that may be optimized for use with the underlying transport implementation.getHost()intgetPort()Returns 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.Gets the currently set TransportListener instancebooleanbooleanisSecure()write(ProtonBuffer output) Writes a chunk of data over the Transport connection without performing an explicit flush on the transport.write(ProtonBuffer output, Runnable ioComplete) Writes a chunk of data over the Transport connection without performing an explicit flush on the transport.writeAndFlush(ProtonBuffer output) Writes a chunk of data over the Transport connection and requests a flush of all pending queued write operationswriteAndFlush(ProtonBuffer output, Runnable ioComplete) Writes a chunk of data over the Transport connection and requests a flush of all pending queued write operations
- 
Method Details- 
connectPerforms the connect operation for the implemented Transport type such as a TCP socket connection, SSL/TLS handshake etc. The connection operation itself will be performed as an asynchronous operation with the success or failure being communicated to the event pointTransportListener.transportError(Throwable). If the users wishes to perform a block on connect outcome theawaitConnect()method will wait for and or throw an error based on the connect outcome.- Parameters:
- host- The remote host that this- Transportshould attempt to connect to.
- port- The port on the remote host that this- Transportshould attempt to bind to.
- listener- The- TransportListenerthat will handle- Transportevents.
- Returns:
- this Transportinstance.
- Throws:
- IOException- if an error occurs while attempting the connect.
 
- 
awaitConnectWaits interruptibly for theTransportto connect to the remote that was indicated in theconnect(String, int, TransportListener)call.- Throws:
- InterruptedException- If the wait mechanism was interrupted while waiting for a successful connect.
- IOException- If the- Transportfailed to connect or was closed before connected.
 
- 
isConnectedboolean isConnected()- Returns:
- true if transport is connected or false if the connection is down.
 
- 
isSecureboolean isSecure()- Returns:
- true if transport is connected using a secured channel (SSL).
 
- 
closeClose the Transport, no additional send operations are accepted.- Throws:
- IOException- if an error occurs while closing the connection.
 
- 
getBufferAllocatorProtonBufferAllocator getBufferAllocator()Gets a buffer allocator that can produceProtonBufferinstance that may be optimized for use with the underlying transport implementation.- Returns:
- a ProtonBufferAllocatorthat creates transport friendly buffers.
 
- 
writeWrites a chunk of data over the Transport connection without performing an explicit flush on the transport.- Parameters:
- output- The buffer of data that is to be transmitted.
- Returns:
- this Transportinstance.
- Throws:
- IOException- if an error occurs during the write operation.
 
- 
writeWrites 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.- Parameters:
- output- The buffer of data that is to be transmitted.
- ioComplete- A- Runnablethat is invoked when the IO operation completes successfully.
- Returns:
- this Transportinstance.
- Throws:
- IOException- if an error occurs during the write operation.
 
- 
writeAndFlushWrites a chunk of data over the Transport connection and requests a flush of all pending queued write operations- Parameters:
- output- The buffer of data that is to be transmitted.
- Returns:
- this Transportinstance.
- Throws:
- IOException- if an error occurs during the write operation.
 
- 
writeAndFlushWrites a chunk of data over the Transport connection and requests a flush of all pending queued write operations- Parameters:
- output- The buffer of data that is to be transmitted.
- ioComplete- A- Runnablethat is invoked when the IO operation completes successfully.
- Returns:
- this Transportinstance.
- Throws:
- IOException- if an error occurs during the write operation.
 
- 
flushRequest a flush of all pending writes to the underlying connection.- Returns:
- this Transportinstance.
- Throws:
- IOException- if an error occurs during the flush operation.
 
- 
getTransportListenerTransportListener getTransportListener()Gets the currently set TransportListener instance- Returns:
- the current TransportListener or null if none set.
 
- 
getTransportOptionsTransportOptions getTransportOptions()- Returns:
- a TransportOptionsinstance copied from the immutable options given at create time..
 
- 
getSslOptionsSslOptions getSslOptions()- Returns:
- a SslOptionsinstance copied from the immutable options given at create time..
 
- 
getHostString getHost()- Returns:
- the host name or IP address that the transport connects to.
 
- 
getPortint getPort()- Returns:
- the port that the transport connects to.
 
- 
getRemoteURIURI getRemoteURI()Returns 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 theconnect(String, int, TransportListener)method this method returnsnull.- Returns:
- a URI that reflects a meaningful view of the Transportremote connection details.
 
- 
getLocalPrincipalPrincipal getLocalPrincipal()- Returns:
- the local principal for a Transport that is using a secure connection.
 
 
-