Package com.linecorp.armeria.client
Class ClientOptions
java.lang.Object
com.linecorp.armeria.common.util.AbstractOptions<ClientOption<Object>,ClientOptionValue<Object>>
com.linecorp.armeria.client.ClientOptions
- All Implemented Interfaces:
Iterable<ClientOptionValue<Object>>
public final class ClientOptions
extends AbstractOptions<ClientOption<Object>,ClientOptionValue<Object>>
A set of
ClientOption
s and their respective values.-
Field Summary
Modifier and TypeFieldDescriptionstatic final ClientOption<Consumer<ClientRequestContext>>
TheClientRequestContext
customizer.static final ClientOption<ClientDecoration>
TheFunction
that decorates the client components.static final ClientOption<Function<? super Endpoint,
? extends EndpointGroup>> static final ClientOption<ClientFactory>
TheClientFactory
used for creating a client.static final ClientOption<HttpHeaders>
The additional HTTP headers to send with requests.static final ClientOption<Long>
The maximum allowed length of a server response.static final ClientOption<RedirectConfig>
The redirect configuration.static final ClientOption<Supplier<RequestId>>
static final ClientOption<Long>
The timeout of a server reply to a client call.static final ClientOption<SuccessFunction>
TheSuccessFunction
that determines if the request is successful or not.static final ClientOption<Long>
The timeout of a socket write. -
Method Summary
Modifier and TypeMethodDescriptionstatic ClientOptionsBuilder
builder()
Returns a newly createdClientOptionsBuilder
.Returns theConsumer
that customizes aClientRequestContext
.Returns theFunction
s that decorate the components of a client.Function<? super Endpoint,
? extends EndpointGroup> factory()
Returns theClientFactory
used for creating a client.headers()
Returns the additional HTTP headers to send with requests.long
Returns the maximum allowed length of a server response.static ClientOptions
of()
Returns an empty singletonClientOptions
.static ClientOptions
of
(ClientOptions baseOptions, ClientOptionValue<?>... additionalValues) Merges the specifiedClientOptions
andClientOptionValue
s.static ClientOptions
of
(ClientOptions baseOptions, Iterable<? extends ClientOptionValue<?>> additionalValues) Merges the specifiedClientOptions
andClientOptionValue
s.static ClientOptions
of
(ClientOptionValue<?>... values) Returns theClientOptions
with the specifiedClientOptionValue
s.static ClientOptions
of
(Iterable<? extends ClientOptionValue<?>> values) Returns theClientOptions
with the specifiedClientOptionValue
s.Returns theRedirectConfig
.long
Returns the timeout of a server reply to a client call.Returns theSuccessFunction
that determines if the request is successful or not.Returns a newClientOptionsBuilder
created from thisClientOptions
.long
Returns the timeout of a socket write.Methods inherited from class com.linecorp.armeria.common.util.AbstractOptions
asMap, get, iterator, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
FACTORY
TheClientFactory
used for creating a client. -
WRITE_TIMEOUT_MILLIS
The timeout of a socket write. -
RESPONSE_TIMEOUT_MILLIS
The timeout of a server reply to a client call. -
MAX_RESPONSE_LENGTH
The maximum allowed length of a server response. -
REDIRECT_CONFIG
The redirect configuration. -
CONTEXT_CUSTOMIZER
TheClientRequestContext
customizer.- See Also:
-
DECORATION
TheFunction
that decorates the client components. -
REQUEST_ID_GENERATOR
-
SUCCESS_FUNCTION
TheSuccessFunction
that determines if the request is successful or not. -
ENDPOINT_REMAPPER
public static final ClientOption<Function<? super Endpoint,? extends EndpointGroup>> ENDPOINT_REMAPPER- See Also:
-
HEADERS
The additional HTTP headers to send with requests.
-
-
Method Details
-
of
Returns an empty singletonClientOptions
. -
of
Returns theClientOptions
with the specifiedClientOptionValue
s. -
of
Returns theClientOptions
with the specifiedClientOptionValue
s. -
of
Merges the specifiedClientOptions
andClientOptionValue
s.- Returns:
- the merged
ClientOptions
-
of
public static ClientOptions of(ClientOptions baseOptions, Iterable<? extends ClientOptionValue<?>> additionalValues) Merges the specifiedClientOptions
andClientOptionValue
s.- Returns:
- the merged
ClientOptions
-
builder
Returns a newly createdClientOptionsBuilder
. -
factory
Returns theClientFactory
used for creating a client. -
writeTimeoutMillis
public long writeTimeoutMillis()Returns the timeout of a socket write. -
responseTimeoutMillis
public long responseTimeoutMillis()Returns the timeout of a server reply to a client call. -
maxResponseLength
public long maxResponseLength()Returns the maximum allowed length of a server response. -
redirectConfig
Returns theRedirectConfig
. -
decoration
Returns theFunction
s that decorate the components of a client. -
headers
Returns the additional HTTP headers to send with requests. Used only when the underlyingSessionProtocol
is HTTP. -
requestIdGenerator
-
successFunction
Returns theSuccessFunction
that determines if the request is successful or not. -
endpointRemapper
- See Also:
-
contextCustomizer
Returns theConsumer
that customizes aClientRequestContext
. -
toBuilder
Returns a newClientOptionsBuilder
created from thisClientOptions
.
-