public abstract class AbstractClientBuilder<I,O,B extends AbstractClientBuilder,C extends RxClient<I,O>>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected io.netty.bootstrap.Bootstrap |
bootstrap |
protected ClientChannelFactory<O,I> |
channelFactory |
protected RxClient.ClientConfig |
clientConfig |
protected ClientConnectionFactory<O,I,? extends ObservableConnection<O,I>> |
connectionFactory |
protected MetricEventsListenerFactory |
eventListenersFactory |
protected io.netty.channel.EventLoopGroup |
eventLoopGroup |
protected MetricEventsSubject<ClientMetricsEvent<?>> |
eventsSubject |
protected PipelineConfigurator<O,I> |
pipelineConfigurator |
protected ConnectionPoolBuilder<O,I> |
poolBuilder |
protected RxClient.ServerInfo |
serverInfo |
protected java.lang.Class<? extends io.netty.channel.Channel> |
socketChannel |
protected io.netty.handler.logging.LogLevel |
wireLogginLevel |
Modifier | Constructor and Description |
---|---|
protected |
AbstractClientBuilder(io.netty.bootstrap.Bootstrap bootstrap,
java.lang.String host,
int port,
ClientConnectionFactory<O,I,? extends ObservableConnection<O,I>> connectionFactory,
ClientChannelFactory<O,I> factory) |
protected |
AbstractClientBuilder(io.netty.bootstrap.Bootstrap bootstrap,
java.lang.String host,
int port,
ConnectionPoolBuilder<O,I> poolBuilder) |
Modifier and Type | Method and Description |
---|---|
B |
appendPipelineConfigurator(PipelineConfigurator<O,I> additionalConfigurator) |
C |
build() |
B |
channel(java.lang.Class<? extends io.netty.channel.Channel> socketChannel) |
<T> B |
channelOption(io.netty.channel.ChannelOption<T> option,
T value) |
B |
config(RxClient.ClientConfig clientConfig) |
protected abstract C |
createClient() |
B |
defaultChannelOptions() |
protected io.netty.channel.EventLoopGroup |
defaultEventloop(java.lang.Class<? extends io.netty.channel.Channel> socketChannel) |
protected java.lang.Class<? extends io.netty.channel.socket.SocketChannel> |
defaultSocketChannelClass() |
B |
defaultTcpOptions() |
B |
defaultUdpOptions() |
B |
enableWireLogging(io.netty.handler.logging.LogLevel wireLogginLevel)
Enables wire level logs (all events received by netty) to be logged at the passed
wireLogginLevel . |
B |
eventloop(io.netty.channel.EventLoopGroup eventLoopGroup) |
protected java.lang.String |
generatedNamePrefix() |
io.netty.bootstrap.Bootstrap |
getBootstrap() |
MetricEventsSubject<ClientMetricsEvent<?>> |
getEventsSubject() |
protected java.lang.String |
getOrCreateName() |
PipelineConfigurator<O,I> |
getPipelineConfigurator() |
protected ConnectionPoolBuilder<O,I> |
getPoolBuilder(boolean createNew) |
RxClient.ServerInfo |
getServerInfo() |
protected abstract MetricEventsListener<? extends ClientMetricsEvent<? extends java.lang.Enum>> |
newMetricsListener(MetricEventsListenerFactory factory,
C client) |
B |
pipelineConfigurator(PipelineConfigurator<O,I> pipelineConfigurator) |
protected B |
returnBuilder() |
B |
withChannelFactory(ClientChannelFactory<O,I> factory) |
B |
withConnectionPoolLimitStrategy(PoolLimitDeterminationStrategy limitDeterminationStrategy) |
B |
withIdleConnectionsTimeoutMillis(long idleConnectionsTimeoutMillis) |
B |
withMaxConnections(int maxConnections) |
B |
withMetricEventsListenerFactory(MetricEventsListenerFactory eventListenersFactory) |
B |
withName(java.lang.String name) |
B |
withNoConnectionPooling()
Overrides all the connection pool settings done previous to this call and disables connection pooling for this
client, unless enabled again after this call returns.
|
B |
withNoIdleConnectionCleanup() |
B |
withPoolIdleCleanupScheduler(java.util.concurrent.ScheduledExecutorService poolIdleCleanupScheduler) |
B |
withSslEngineFactory(SSLEngineFactory sslEngineFactory) |
protected final RxClient.ServerInfo serverInfo
protected final io.netty.bootstrap.Bootstrap bootstrap
protected final ClientConnectionFactory<O,I,? extends ObservableConnection<O,I>> connectionFactory
protected ClientChannelFactory<O,I> channelFactory
protected ConnectionPoolBuilder<O,I> poolBuilder
protected PipelineConfigurator<O,I> pipelineConfigurator
protected java.lang.Class<? extends io.netty.channel.Channel> socketChannel
protected io.netty.channel.EventLoopGroup eventLoopGroup
protected RxClient.ClientConfig clientConfig
protected io.netty.handler.logging.LogLevel wireLogginLevel
protected MetricEventsListenerFactory eventListenersFactory
protected MetricEventsSubject<ClientMetricsEvent<?>> eventsSubject
protected AbstractClientBuilder(io.netty.bootstrap.Bootstrap bootstrap, java.lang.String host, int port, ClientConnectionFactory<O,I,? extends ObservableConnection<O,I>> connectionFactory, ClientChannelFactory<O,I> factory)
protected AbstractClientBuilder(io.netty.bootstrap.Bootstrap bootstrap, java.lang.String host, int port, ConnectionPoolBuilder<O,I> poolBuilder)
public B defaultChannelOptions()
public B defaultTcpOptions()
public B defaultUdpOptions()
public B pipelineConfigurator(PipelineConfigurator<O,I> pipelineConfigurator)
public <T> B channelOption(io.netty.channel.ChannelOption<T> option, T value)
public B channel(java.lang.Class<? extends io.netty.channel.Channel> socketChannel)
public B eventloop(io.netty.channel.EventLoopGroup eventLoopGroup)
public B config(RxClient.ClientConfig clientConfig)
public B withMaxConnections(int maxConnections)
public B withIdleConnectionsTimeoutMillis(long idleConnectionsTimeoutMillis)
public B withConnectionPoolLimitStrategy(PoolLimitDeterminationStrategy limitDeterminationStrategy)
public B withPoolIdleCleanupScheduler(java.util.concurrent.ScheduledExecutorService poolIdleCleanupScheduler)
public B withNoIdleConnectionCleanup()
public PipelineConfigurator<O,I> getPipelineConfigurator()
public B appendPipelineConfigurator(PipelineConfigurator<O,I> additionalConfigurator)
public B withChannelFactory(ClientChannelFactory<O,I> factory)
public B enableWireLogging(io.netty.handler.logging.LogLevel wireLogginLevel)
wireLogginLevel
. LogLevel.WARN
or
LogLevel.ERROR
, if this wire level logging is required for all requests (not at all recommended as this
logging is very verbose), the passed level must be LogLevel.WARN
or LogLevel.ERROR
respectively. LogLevel.DEBUG
and then dynamically enabled disable this log level
whenever required. wireLogginLevel
- Log level at which the wire level logs will be logged.LoggingHandler
public B withName(java.lang.String name)
public B withMetricEventsListenerFactory(MetricEventsListenerFactory eventListenersFactory)
public B withNoConnectionPooling()
public B withSslEngineFactory(SSLEngineFactory sslEngineFactory)
public io.netty.bootstrap.Bootstrap getBootstrap()
public RxClient.ServerInfo getServerInfo()
public MetricEventsSubject<ClientMetricsEvent<?>> getEventsSubject()
public C build()
protected io.netty.channel.EventLoopGroup defaultEventloop(java.lang.Class<? extends io.netty.channel.Channel> socketChannel)
protected java.lang.Class<? extends io.netty.channel.socket.SocketChannel> defaultSocketChannelClass()
protected abstract C createClient()
protected B returnBuilder()
protected ConnectionPoolBuilder<O,I> getPoolBuilder(boolean createNew)
protected java.lang.String getOrCreateName()
protected java.lang.String generatedNamePrefix()
protected abstract MetricEventsListener<? extends ClientMetricsEvent<? extends java.lang.Enum>> newMetricsListener(MetricEventsListenerFactory factory, C client)