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
<Boolean> Whether to add anHttpHeaderNames.ORIGIN
header automatically when sending anHttpRequest
when theHttpRequest.headers()
does not have it.static final ClientOption
<Consumer<ClientRequestContext>> TheClientRequestContext
customizer.static final ClientOption
<Supplier<? extends AutoCloseable>> 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
<Long> The amount of time in millis to wait before aborting anHttpRequest
when its correspondingHttpResponse
is complete.static final ClientOption
<Supplier<RequestId>> static final ClientOption
<Long> The timeout of a server reply to a client call.static final ClientOption
<ResponseTimeoutMode> 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 TypeMethodDescriptionboolean
Returns whether to add anHttpHeaderNames.ORIGIN
header automatically when sending anHttpRequest
when theHttpRequest.headers()
does not have it.static ClientOptionsBuilder
builder()
Returns a newly createdClientOptionsBuilder
.Returns theConsumer
that customizes aClientRequestContext
.Returns theSupplier
which provides anAutoCloseable
and will be called whenever thisRequestContext
is popped from theRequestContextStorage
.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 amount of time in millis to wait before aborting anHttpRequest
when its correspondingHttpResponse
is complete.long
Returns the timeout of a server reply to a client call.Returns theResponseTimeoutMode
which determines when aresponseTimeoutMillis()
will start to be scheduled.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. -
REQUEST_AUTO_ABORT_DELAY_MILLIS
The amount of time in millis to wait before aborting anHttpRequest
when its correspondingHttpResponse
is complete. -
AUTO_FILL_ORIGIN_HEADER
Whether to add anHttpHeaderNames.ORIGIN
header automatically when sending anHttpRequest
when theHttpRequest.headers()
does not have it.- See Also:
-
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:
-
CONTEXT_HOOK
-
RESPONSE_TIMEOUT_MODE
-
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. -
requestAutoAbortDelayMillis
public long requestAutoAbortDelayMillis()Returns the amount of time in millis to wait before aborting anHttpRequest
when its correspondingHttpResponse
is complete. -
autoFillOriginHeader
Returns whether to add anHttpHeaderNames.ORIGIN
header automatically when sending anHttpRequest
when theHttpRequest.headers()
does not have it. -
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
. -
contextHook
Returns theSupplier
which provides anAutoCloseable
and will be called whenever thisRequestContext
is popped from theRequestContextStorage
. -
responseTimeoutMode
Returns theResponseTimeoutMode
which determines when aresponseTimeoutMillis()
will start to be scheduled.- See Also:
-
toBuilder
Returns a newClientOptionsBuilder
created from thisClientOptions
.
-