Package com.linecorp.armeria.client
Class ClientFactoryOption<T>
java.lang.Object
com.linecorp.armeria.common.util.AbstractOption<ClientFactoryOption<T>,ClientFactoryOptionValue<T>,T>
com.linecorp.armeria.client.ClientFactoryOption<T>
- Type Parameters:
T
- the type of the option value
- All Implemented Interfaces:
Comparable<AbstractOption<?,?,?>>
public final class ClientFactoryOption<T> extends AbstractOption<ClientFactoryOption<T>,ClientFactoryOptionValue<T>,T>
A
ClientFactory
option.-
Nested Class Summary
Nested classes/interfaces inherited from class com.linecorp.armeria.common.util.AbstractOption
AbstractOption.Factory<T extends AbstractOption<T,U,V>,U extends AbstractOptionValue<U,T,V>,V>
-
Field Summary
Fields Modifier and Type Field Description static ClientFactoryOption<Function<? super EventLoopGroup,? extends AddressResolverGroup<? extends InetSocketAddress>>>
ADDRESS_RESOLVER_GROUP_FACTORY
The factory that creates anAddressResolverGroup
which resolves remote addresses intoInetSocketAddress
es.static ClientFactoryOption<Map<ChannelOption<?>,Object>>
CHANNEL_OPTIONS
TheChannelOption
s of the sockets created by theClientFactory
.static ClientFactoryOption<ConnectionPoolListener>
CONNECTION_POOL_LISTENER
The listener which is notified on a connection pool event.static ClientFactoryOption<Function<? super EventLoopGroup,? extends EventLoopScheduler>>
EVENT_LOOP_SCHEDULER_FACTORY
The factory that creates anEventLoopScheduler
which is responsible for assigning anEventLoop
to handle a connection to the specifiedEndpoint
.static ClientFactoryOption<Integer>
HTTP1_MAX_CHUNK_SIZE
The maximum length of each chunk in an HTTP/1 response content.static ClientFactoryOption<Integer>
HTTP1_MAX_HEADER_SIZE
The maximum length of all headers in an HTTP/1 response.static ClientFactoryOption<Integer>
HTTP1_MAX_INITIAL_LINE_LENGTH
The maximum length of an HTTP/1 response initial line.static ClientFactoryOption<Integer>
HTTP2_INITIAL_CONNECTION_WINDOW_SIZE
The HTTP/2 initial connection flow-control window size.static ClientFactoryOption<Integer>
HTTP2_INITIAL_STREAM_WINDOW_SIZE
The SETTINGS_INITIAL_WINDOW_SIZE for HTTP/2 stream-level flow control.static ClientFactoryOption<Integer>
HTTP2_MAX_FRAME_SIZE
The SETTINGS_MAX_FRAME_SIZE that indicates the size of the largest frame payload that this client is willing to receive.static ClientFactoryOption<Long>
HTTP2_MAX_HEADER_LIST_SIZE
The HTTP/2 SETTINGS_MAX_HEADER_LIST_SIZE that indicates the maximum size of header list that the client is prepared to accept, in octets.static ClientFactoryOption<Long>
IDLE_TIMEOUT_MILLIS
The idle timeout of a socket connection in milliseconds.static ClientFactoryOption<MeterRegistry>
METER_REGISTRY
TheMeterRegistry
which collects various stats.static ClientFactoryOption<Long>
PING_INTERVAL_MILLIS
The PING interval in milliseconds.static ClientFactoryOption<ProxyConfig>
PROXY_CONFIG
TheProxyConfig
which contains proxy related configuration.static ClientFactoryOption<Boolean>
SHUTDOWN_WORKER_GROUP_ON_CLOSE
Whether to shut down the workerEventLoopGroup
when theClientFactory
is closed.static ClientFactoryOption<Consumer<? super SslContextBuilder>>
TLS_CUSTOMIZER
TheConsumer
which can arbitrarily configure theSslContextBuilder
that will be applied to the SSL session.static ClientFactoryOption<Boolean>
USE_HTTP1_PIPELINING
Whether to use HTTP pipelining for HTTP/1 connections.static ClientFactoryOption<Boolean>
USE_HTTP2_PREFACE
Whether to send an HTTP/2 preface string instead of an HTTP/1 upgrade request to negotiate the protocol version of a cleartext HTTP connection.static ClientFactoryOption<EventLoopGroup>
WORKER_GROUP
The workerEventLoopGroup
. -
Method Summary
Modifier and Type Method Description static Set<ClientFactoryOption<?>>
allOptions()
Returns the all availableClientFactoryOption
s.static <T> ClientFactoryOption<T>
define(String name, T defaultValue)
Defines a newClientFactoryOption
of the specified name and default value.static <T> ClientFactoryOption<T>
define(String name, T defaultValue, Function<T,T> validator, BiFunction<ClientFactoryOptionValue<T>,ClientFactoryOptionValue<T>,ClientFactoryOptionValue<T>> mergeFunction)
Defines a newClientFactoryOption
of the specified name, default value and merge function.protected ClientFactoryOptionValue<T>
doNewValue(T value)
Implement this method to return a new option value.static ClientFactoryOption<?>
of(String name)
Returns theClientFactoryOption
with the specifiedname
.Methods inherited from class com.linecorp.armeria.common.util.AbstractOption
allOptions, compareTo, defaultValue, define, equals, hashCode, name, newValue, of, toString
-
Field Details
-
WORKER_GROUP
The workerEventLoopGroup
. -
SHUTDOWN_WORKER_GROUP_ON_CLOSE
Whether to shut down the workerEventLoopGroup
when theClientFactory
is closed. -
EVENT_LOOP_SCHEDULER_FACTORY
public static final ClientFactoryOption<Function<? super EventLoopGroup,? extends EventLoopScheduler>> EVENT_LOOP_SCHEDULER_FACTORYThe factory that creates anEventLoopScheduler
which is responsible for assigning anEventLoop
to handle a connection to the specifiedEndpoint
. -
CHANNEL_OPTIONS
TheChannelOption
s of the sockets created by theClientFactory
. -
TLS_CUSTOMIZER
TheConsumer
which can arbitrarily configure theSslContextBuilder
that will be applied to the SSL session. -
ADDRESS_RESOLVER_GROUP_FACTORY
public static final ClientFactoryOption<Function<? super EventLoopGroup,? extends AddressResolverGroup<? extends InetSocketAddress>>> ADDRESS_RESOLVER_GROUP_FACTORYThe factory that creates anAddressResolverGroup
which resolves remote addresses intoInetSocketAddress
es. -
HTTP2_INITIAL_CONNECTION_WINDOW_SIZE
The HTTP/2 initial connection flow-control window size. -
HTTP2_INITIAL_STREAM_WINDOW_SIZE
The SETTINGS_INITIAL_WINDOW_SIZE for HTTP/2 stream-level flow control. -
HTTP2_MAX_FRAME_SIZE
The SETTINGS_MAX_FRAME_SIZE that indicates the size of the largest frame payload that this client is willing to receive. -
HTTP2_MAX_HEADER_LIST_SIZE
The HTTP/2 SETTINGS_MAX_HEADER_LIST_SIZE that indicates the maximum size of header list that the client is prepared to accept, in octets. -
HTTP1_MAX_INITIAL_LINE_LENGTH
The maximum length of an HTTP/1 response initial line. -
HTTP1_MAX_HEADER_SIZE
The maximum length of all headers in an HTTP/1 response. -
HTTP1_MAX_CHUNK_SIZE
The maximum length of each chunk in an HTTP/1 response content. -
IDLE_TIMEOUT_MILLIS
The idle timeout of a socket connection in milliseconds. -
PING_INTERVAL_MILLIS
-
USE_HTTP2_PREFACE
Whether to send an HTTP/2 preface string instead of an HTTP/1 upgrade request to negotiate the protocol version of a cleartext HTTP connection. -
USE_HTTP1_PIPELINING
Whether to use HTTP pipelining for HTTP/1 connections. -
CONNECTION_POOL_LISTENER
The listener which is notified on a connection pool event. -
METER_REGISTRY
TheMeterRegistry
which collects various stats. -
PROXY_CONFIG
TheProxyConfig
which contains proxy related configuration.
-
-
Method Details
-
allOptions
Returns the all availableClientFactoryOption
s. -
of
Returns theClientFactoryOption
with the specifiedname
.- Throws:
NoSuchElementException
- if there's no such option defined.
-
define
Defines a newClientFactoryOption
of the specified name and default value.- Parameters:
name
- the name of the option.defaultValue
- the default value of the option, which will be used when unspecified.- Throws:
IllegalStateException
- if an option with the specified name exists already.
-
define
public static <T> ClientFactoryOption<T> define(String name, T defaultValue, Function<T,T> validator, BiFunction<ClientFactoryOptionValue<T>,ClientFactoryOptionValue<T>,ClientFactoryOptionValue<T>> mergeFunction)Defines a newClientFactoryOption
of the specified name, default value and merge function.- Parameters:
name
- the name of the option.defaultValue
- the default value of the option, which will be used when unspecified.validator
- theFunction
which is used for validating and normalizing an option value.mergeFunction
- theBiFunction
which is used for merging old and new option values.- Throws:
IllegalStateException
- if an option with the specified name exists already.
-
doNewValue
Description copied from class:AbstractOption
Implement this method to return a new option value.- Specified by:
doNewValue
in classAbstractOption<ClientFactoryOption<T>,ClientFactoryOptionValue<T>,T>
-