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
ClientOptions and their respective values.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ClientOption<Boolean>Whether to add anHttpHeaderNames.ORIGINheader automatically when sending anHttpRequestwhen theHttpRequest.headers()does not have it.static final ClientOption<Consumer<ClientRequestContext>>TheClientRequestContextcustomizer.static final ClientOption<Supplier<? extends AutoCloseable>>static final ClientOption<ClientDecoration>TheFunctionthat decorates the client components.static final ClientOption<Function<? super Endpoint,? extends EndpointGroup>> static final ClientOption<ClientFactory>TheClientFactoryused 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 anHttpRequestwhen its correspondingHttpResponseis complete.static final ClientOption<Supplier<RequestId>>static final ClientOption<Long>The timeout of a server reply to a client call.static final ClientOption<SuccessFunction>TheSuccessFunctionthat determines if the request is successful or not.static final ClientOption<Long>The timeout of a socket write. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether to add anHttpHeaderNames.ORIGINheader automatically when sending anHttpRequestwhen theHttpRequest.headers()does not have it.static ClientOptionsBuilderbuilder()Returns a newly createdClientOptionsBuilder.Returns theConsumerthat customizes aClientRequestContext.Returns theSupplierwhich provides anAutoCloseableand will be called whenever thisRequestContextis popped from theRequestContextStorage.Returns theFunctions that decorate the components of a client.Function<? super Endpoint,? extends EndpointGroup> factory()Returns theClientFactoryused for creating a client.headers()Returns the additional HTTP headers to send with requests.longReturns the maximum allowed length of a server response.static ClientOptionsof()Returns an empty singletonClientOptions.static ClientOptionsof(ClientOptions baseOptions, ClientOptionValue<?>... additionalValues) Merges the specifiedClientOptionsandClientOptionValues.static ClientOptionsof(ClientOptions baseOptions, Iterable<? extends ClientOptionValue<?>> additionalValues) Merges the specifiedClientOptionsandClientOptionValues.static ClientOptionsof(ClientOptionValue<?>... values) Returns theClientOptionswith the specifiedClientOptionValues.static ClientOptionsof(Iterable<? extends ClientOptionValue<?>> values) Returns theClientOptionswith the specifiedClientOptionValues.Returns theRedirectConfig.longReturns the amount of time in millis to wait before aborting anHttpRequestwhen its correspondingHttpResponseis complete.longReturns the timeout of a server reply to a client call.Returns theSuccessFunctionthat determines if the request is successful or not.Returns a newClientOptionsBuildercreated from thisClientOptions.longReturns the timeout of a socket write.Methods inherited from class com.linecorp.armeria.common.util.AbstractOptions
asMap, get, iterator, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
FACTORY
TheClientFactoryused 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 anHttpRequestwhen its correspondingHttpResponseis complete. -
AUTO_FILL_ORIGIN_HEADER
Whether to add anHttpHeaderNames.ORIGINheader automatically when sending anHttpRequestwhen theHttpRequest.headers()does not have it.- See Also:
-
REDIRECT_CONFIG
The redirect configuration. -
CONTEXT_CUSTOMIZER
TheClientRequestContextcustomizer.- See Also:
-
DECORATION
TheFunctionthat decorates the client components. -
REQUEST_ID_GENERATOR
-
SUCCESS_FUNCTION
TheSuccessFunctionthat 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
-
HEADERS
The additional HTTP headers to send with requests.
-
-
Method Details
-
of
Returns an empty singletonClientOptions. -
of
Returns theClientOptionswith the specifiedClientOptionValues. -
of
Returns theClientOptionswith the specifiedClientOptionValues. -
of
Merges the specifiedClientOptionsandClientOptionValues.- Returns:
- the merged
ClientOptions
-
of
public static ClientOptions of(ClientOptions baseOptions, Iterable<? extends ClientOptionValue<?>> additionalValues) Merges the specifiedClientOptionsandClientOptionValues.- Returns:
- the merged
ClientOptions
-
builder
Returns a newly createdClientOptionsBuilder. -
factory
Returns theClientFactoryused 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 anHttpRequestwhen its correspondingHttpResponseis complete. -
autoFillOriginHeader
Returns whether to add anHttpHeaderNames.ORIGINheader automatically when sending anHttpRequestwhen theHttpRequest.headers()does not have it. -
redirectConfig
Returns theRedirectConfig. -
decoration
Returns theFunctions that decorate the components of a client. -
headers
Returns the additional HTTP headers to send with requests. Used only when the underlyingSessionProtocolis HTTP. -
requestIdGenerator
-
successFunction
Returns theSuccessFunctionthat determines if the request is successful or not. -
endpointRemapper
- See Also:
-
contextCustomizer
Returns theConsumerthat customizes aClientRequestContext. -
contextHook
Returns theSupplierwhich provides anAutoCloseableand will be called whenever thisRequestContextis popped from theRequestContextStorage. -
toBuilder
Returns a newClientOptionsBuildercreated from thisClientOptions.
-