public interface Transport
| Modifier and Type | Method and Description |
|---|---|
io.netty.buffer.ByteBuf |
allocateSendBuffer(int size)
Request that the Transport provide an output buffer sized for the given
value.
|
void |
close()
Close the Transport, no additional send operations are accepted.
|
ScheduledExecutorService |
connect(Runnable initRoutine,
SSLContext sslContextOverride)
Performs the connect operation for the implemented Transport type
such as a TCP socket connection, SSL/TLS handshake etc.
|
void |
flush()
Request a flush of all pending writes to the underlying connection.
|
Principal |
getLocalPrincipal() |
int |
getMaxFrameSize()
Returns the currently configured maximum frame size setting.
|
URI |
getRemoteLocation() |
ThreadFactory |
getThreadFactory() |
TransportListener |
getTransportListener()
Gets the currently set TransportListener instance
|
TransportOptions |
getTransportOptions() |
boolean |
isConnected() |
boolean |
isSecure() |
void |
setMaxFrameSize(int maxFrameSize)
Sets the Maximum Frame Size the transport should accept from the remote.
|
void |
setThreadFactory(ThreadFactory factory)
Sets the
ThreadFactory that the Transport should use when creating the Transport
IO thread for processing. |
void |
setTransportListener(TransportListener listener)
Sets the Transport Listener instance that will be notified of incoming data or
error events.
|
void |
write(io.netty.buffer.ByteBuf output)
Writes a chunk of data over the Transport connection without performing an
explicit flush on the transport.
|
void |
writeAndFlush(io.netty.buffer.ByteBuf output)
Writes a chunk of data over the Transport connection and requests a flush of
all pending queued write operations
|
ScheduledExecutorService connect(Runnable initRoutine, SSLContext sslContextOverride) throws IOException
initRoutine - a runnable initialization method that is executed in the context
of the transport's IO thread to allow thread safe setup of resources
that will be run from the transport executor service.sslContextOverride - a user-provided SSLContext to use if establishing a secure
connection, overrides applicable URI configurationIOException - if an error occurs while attempting the connect.boolean isConnected()
boolean isSecure()
void close()
throws IOException
IOException - if an error occurs while closing the connection.io.netty.buffer.ByteBuf allocateSendBuffer(int size)
throws IOException
size - the size necessary to hold the outgoing bytes.IOException - if an error occurs while allocating the send buffer.void write(io.netty.buffer.ByteBuf output)
throws IOException
output - The buffer of data that is to be transmitted.IOException - if an error occurs during the write operation.void writeAndFlush(io.netty.buffer.ByteBuf output)
throws IOException
output - The buffer of data that is to be transmitted.IOException - if an error occurs during the write operation.void flush()
throws IOException
IOException - if an error occurs during the flush operation.TransportListener getTransportListener()
void setTransportListener(TransportListener listener)
listener - The new TransportListener instance to use (cannot be null).IllegalArgumentException - if the given listener is null.ThreadFactory getThreadFactory()
ThreadFactory used to create the IO thread for this Transportvoid setThreadFactory(ThreadFactory factory)
ThreadFactory that the Transport should use when creating the Transport
IO thread for processing.factory - The ThreadFactoryIllegalStateException - if called after a call to connect(Runnable, SSLContext)TransportOptions getTransportOptions()
URI getRemoteLocation()
Principal getLocalPrincipal()
void setMaxFrameSize(int maxFrameSize)
maxFrameSize - The maximum frame size to accept from the remote.int getMaxFrameSize()
Copyright © 2013–2019 The Apache Software Foundation. All rights reserved.