public final class TcpClientImpl<W,R> extends TcpClient<W,R>
| Modifier and Type | Method and Description |
|---|---|
<WW,RR> TcpClient<WW,RR> |
addChannelHandlerAfter(io.netty.util.concurrent.EventExecutorGroup group,
java.lang.String baseName,
java.lang.String name,
rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
Adds a
ChannelHandler to ChannelPipeline for all connections created by this client. |
<WW,RR> TcpClient<WW,RR> |
addChannelHandlerAfter(java.lang.String baseName,
java.lang.String name,
rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
Adds a
ChannelHandler to ChannelPipeline for all connections created by this client. |
<WW,RR> TcpClient<WW,RR> |
addChannelHandlerBefore(io.netty.util.concurrent.EventExecutorGroup group,
java.lang.String baseName,
java.lang.String name,
rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
Adds a
ChannelHandler to ChannelPipeline for all connections created by this client. |
<WW,RR> TcpClient<WW,RR> |
addChannelHandlerBefore(java.lang.String baseName,
java.lang.String name,
rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
Adds a
ChannelHandler to ChannelPipeline for all connections created by this client. |
<WW,RR> TcpClient<WW,RR> |
addChannelHandlerFirst(io.netty.util.concurrent.EventExecutorGroup group,
java.lang.String name,
rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
Adds a
ChannelHandler to ChannelPipeline for all connections created by this client. |
<WW,RR> TcpClient<WW,RR> |
addChannelHandlerFirst(java.lang.String name,
rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
Adds a
ChannelHandler to ChannelPipeline for all connections created by this client. |
<WW,RR> TcpClient<WW,RR> |
addChannelHandlerLast(io.netty.util.concurrent.EventExecutorGroup group,
java.lang.String name,
rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
Adds a
ChannelHandler to ChannelPipeline for all connections created by this client. |
<WW,RR> TcpClient<WW,RR> |
addChannelHandlerLast(java.lang.String name,
rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
Adds a
ChannelHandler to ChannelPipeline for all connections created by this client. |
<T> TcpClient<W,R> |
channelOption(io.netty.channel.ChannelOption<T> option,
T value)
Creates a new client instances, inheriting all configurations from this client and adding a
ChannelOption for the connections created by the newly created client instance. |
TcpClient<W,R> |
channelProvider(io.reactivex.netty.client.ChannelProviderFactory providerFactory)
Creates a new client instance, inheriting all configurations from this client and using the passed
providerFactory. |
static <W,R> TcpClientImpl<W,R> |
create(io.reactivex.netty.client.ConnectionProviderFactory<W,R> factory,
rx.Observable<io.reactivex.netty.client.Host> hostStream) |
static <W,R> TcpClientImpl<W,R> |
create(java.net.SocketAddress socketAddress) |
io.reactivex.netty.client.ConnectionRequest<W,R> |
createConnectionRequest()
Creates a new
ConnectionRequest which should be subscribed to actually connect to the target server. |
TcpClient<W,R> |
enableWireLogging(io.netty.handler.logging.LogLevel wireLoggingLevel)
Creates a new client instances, inheriting all configurations from this client and enabling wire logging at the
passed level for the newly created client instance.
|
TcpClientInterceptorChain<W,R> |
intercept()
Starts the process of adding interceptors to this client.
|
<WW,RR> TcpClient<WW,RR> |
pipelineConfigurator(rx.functions.Action1<io.netty.channel.ChannelPipeline> pipelineConfigurator)
Creates a new client instances, inheriting all configurations from this client and using the passed
action to configure all the connections created by the newly created client instance.
|
TcpClient<W,R> |
readTimeOut(int timeOut,
java.util.concurrent.TimeUnit timeUnit)
Creates a new client instances, inheriting all configurations from this client and enables read timeout for all
the connection created by this client.
|
TcpClient<W,R> |
secure(rx.functions.Func1<io.netty.buffer.ByteBufAllocator,javax.net.ssl.SSLEngine> sslEngineFactory)
Creates a new client instance, inheriting all configurations from this client and using the passed
sslEngineFactory for all secured connections created by the newly created client instance. |
TcpClient<W,R> |
secure(io.reactivex.netty.ssl.SslCodec sslCodec)
Creates a new client instance, inheriting all configurations from this client and using the passed
sslCodec for all secured connections created by the newly created client instance. |
TcpClient<W,R> |
secure(javax.net.ssl.SSLEngine sslEngine)
Creates a new client instance, inheriting all configurations from this client and using the passed
sslEngine for all secured connections created by the newly created client instance. |
rx.Subscription |
subscribe(TcpClientEventListener listener) |
TcpClient<W,R> |
unsafeSecure()
Creates a new client instance, inheriting all configurations from this client and using a trust-all
TrustManagerFactoryfor all secured connections created by the newly created client instance. |
public io.reactivex.netty.client.ConnectionRequest<W,R> createConnectionRequest()
InterceptingTcpClientConnectionRequest which should be subscribed to actually connect to the target server.createConnectionRequest in class InterceptingTcpClient<W,R>ConnectionRequest which either can be subscribed directly or altered in various ways
before subscription.public <T> TcpClient<W,R> channelOption(io.netty.channel.ChannelOption<T> option, T value)
TcpClientChannelOption for the connections created by the newly created client instance.channelOption in class TcpClient<W,R>option - Option to add.value - Value for the option.TcpClient instance.public TcpClient<W,R> readTimeOut(int timeOut, java.util.concurrent.TimeUnit timeUnit)
TcpClientreadTimeOut in class TcpClient<W,R>timeOut - Read timeout duration.timeUnit - Read timeout time unit.TcpClient instance.public <WW,RR> TcpClient<WW,RR> addChannelHandlerFirst(java.lang.String name, rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
TcpClientChannelHandler to ChannelPipeline for all connections created by this client. The specified
handler is added at the first position of the pipeline as specified by
ChannelPipeline.addFirst(String, ChannelHandler)
For better flexibility of pipeline modification, the method TcpClient.pipelineConfigurator(Action1) will be more
convenient.addChannelHandlerFirst in class TcpClient<W,R>name - Name of the handler.handlerFactory - Factory to create handler instance to add.TcpClient instance.public <WW,RR> TcpClient<WW,RR> addChannelHandlerFirst(io.netty.util.concurrent.EventExecutorGroup group, java.lang.String name, rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
TcpClientChannelHandler to ChannelPipeline for all connections created by this client. The specified
handler is added at the first position of the pipeline as specified by
ChannelPipeline.addFirst(EventExecutorGroup, String, ChannelHandler)
For better flexibility of pipeline modification, the method TcpClient.pipelineConfigurator(Action1) will be more
convenient.addChannelHandlerFirst in class TcpClient<W,R>group - the EventExecutorGroup which will be used to execute the ChannelHandler
methodsname - the name of the handler to appendhandlerFactory - Factory to create handler instance to add.TcpClient instance.public <WW,RR> TcpClient<WW,RR> addChannelHandlerLast(java.lang.String name, rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
TcpClientChannelHandler to ChannelPipeline for all connections created by this client. The specified
handler is added at the last position of the pipeline as specified by
ChannelPipeline.addLast(String, ChannelHandler)
For better flexibility of pipeline modification, the method TcpClient.pipelineConfigurator(Action1) will be more
convenient.addChannelHandlerLast in class TcpClient<W,R>name - Name of the handler.handlerFactory - Factory to create handler instance to add.TcpClient instance.public <WW,RR> TcpClient<WW,RR> addChannelHandlerLast(io.netty.util.concurrent.EventExecutorGroup group, java.lang.String name, rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
TcpClientChannelHandler to ChannelPipeline for all connections created by this client. The specified
handler is added at the last position of the pipeline as specified by
ChannelPipeline.addLast(EventExecutorGroup, String, ChannelHandler)
For better flexibility of pipeline modification, the method TcpClient.pipelineConfigurator(Action1) will be more
convenient.addChannelHandlerLast in class TcpClient<W,R>group - the EventExecutorGroup which will be used to execute the ChannelHandler
methodsname - the name of the handler to appendhandlerFactory - Factory to create handler instance to add.TcpClient instance.public <WW,RR> TcpClient<WW,RR> addChannelHandlerBefore(java.lang.String baseName, java.lang.String name, rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
TcpClientChannelHandler to ChannelPipeline for all connections created by this client. The specified
handler is added before an existing handler with the passed baseName in the pipeline as specified by
ChannelPipeline.addBefore(String, String, ChannelHandler)
For better flexibility of pipeline modification, the method TcpClient.pipelineConfigurator(Action1) will be more
convenient.addChannelHandlerBefore in class TcpClient<W,R>baseName - the name of the existing handlername - Name of the handler.handlerFactory - Factory to create handler instance to add.TcpClient instance.public <WW,RR> TcpClient<WW,RR> addChannelHandlerBefore(io.netty.util.concurrent.EventExecutorGroup group, java.lang.String baseName, java.lang.String name, rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
TcpClientChannelHandler to ChannelPipeline for all connections created by this client. The specified
handler is added before an existing handler with the passed baseName in the pipeline as specified by
ChannelPipeline.addBefore(EventExecutorGroup, String, String, ChannelHandler)
For better flexibility of pipeline modification, the method TcpClient.pipelineConfigurator(Action1) will be more
convenient.addChannelHandlerBefore in class TcpClient<W,R>group - the EventExecutorGroup which will be used to execute the ChannelHandler
methodsbaseName - the name of the existing handlername - the name of the handler to appendhandlerFactory - Factory to create handler instance to add.TcpClient instance.public <WW,RR> TcpClient<WW,RR> addChannelHandlerAfter(java.lang.String baseName, java.lang.String name, rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
TcpClientChannelHandler to ChannelPipeline for all connections created by this client. The specified
handler is added after an existing handler with the passed baseName in the pipeline as specified by
ChannelPipeline.addAfter(String, String, ChannelHandler)
For better flexibility of pipeline modification, the method TcpClient.pipelineConfigurator(Action1) will be more
convenient.addChannelHandlerAfter in class TcpClient<W,R>baseName - the name of the existing handlername - Name of the handler.handlerFactory - Factory to create handler instance to add.TcpClient instance.public <WW,RR> TcpClient<WW,RR> addChannelHandlerAfter(io.netty.util.concurrent.EventExecutorGroup group, java.lang.String baseName, java.lang.String name, rx.functions.Func0<io.netty.channel.ChannelHandler> handlerFactory)
TcpClientChannelHandler to ChannelPipeline for all connections created by this client. The specified
handler is added after an existing handler with the passed baseName in the pipeline as specified by
ChannelPipeline.addAfter(EventExecutorGroup, String, String, ChannelHandler)
For better flexibility of pipeline modification, the method TcpClient.pipelineConfigurator(Action1) will be more
convenient.addChannelHandlerAfter in class TcpClient<W,R>group - the EventExecutorGroup which will be used to execute the ChannelHandler
methodsbaseName - the name of the existing handlername - the name of the handler to appendhandlerFactory - Factory to create handler instance to add.TcpClient instance.public <WW,RR> TcpClient<WW,RR> pipelineConfigurator(rx.functions.Action1<io.netty.channel.ChannelPipeline> pipelineConfigurator)
TcpClientpipelineConfigurator in class TcpClient<W,R>pipelineConfigurator - Action to configure ChannelPipeline.TcpClient instance.public TcpClient<W,R> enableWireLogging(io.netty.handler.logging.LogLevel wireLoggingLevel)
TcpClientenableWireLogging in class TcpClient<W,R>wireLoggingLevel - Logging level at which the wire logs will be logged. The wire logging will only be done if
logging is enabled at this level for LoggingHandlerTcpClient instance.public TcpClient<W,R> secure(rx.functions.Func1<io.netty.buffer.ByteBufAllocator,javax.net.ssl.SSLEngine> sslEngineFactory)
TcpClientsslEngineFactory for all secured connections created by the newly created client instance.
If the SSLEngine instance can be statically, created, TcpClient.secure(SSLEngine) can be used.public TcpClient<W,R> secure(javax.net.ssl.SSLEngine sslEngine)
TcpClientsslEngine for all secured connections created by the newly created client instance.
If the SSLEngine instance can not be statically, created, TcpClient.secure(Func1) )} can be used.public TcpClient<W,R> secure(io.reactivex.netty.ssl.SslCodec sslCodec)
TcpClientsslCodec for all secured connections created by the newly created client instance.
This is required only when the SslHandler used by SslCodec is to be modified before adding to
the ChannelPipeline. For most of the cases, TcpClient.secure(Func1) or TcpClient.secure(SSLEngine) will be
enough.public TcpClient<W,R> unsafeSecure()
TcpClientTrustManagerFactoryfor all secured connections created by the newly created client instance.
This is only for testing and should not be used for real production clients.unsafeSecure in class TcpClient<W,R>TcpClient instance.public TcpClient<W,R> channelProvider(io.reactivex.netty.client.ChannelProviderFactory providerFactory)
TcpClientproviderFactory.channelProvider in class TcpClient<W,R>providerFactory - Channel provider factory.TcpClient instance.public rx.Subscription subscribe(TcpClientEventListener listener)
public TcpClientInterceptorChain<W,R> intercept()
InterceptingTcpClientintercept in class InterceptingTcpClient<W,R>public static <W,R> TcpClientImpl<W,R> create(java.net.SocketAddress socketAddress)
public static <W,R> TcpClientImpl<W,R> create(io.reactivex.netty.client.ConnectionProviderFactory<W,R> factory, rx.Observable<io.reactivex.netty.client.Host> hostStream)