U - the type of address before resolution (unresolved address)R - the type of address after resolution (resolved address)public interface MultiAddressHttpClientBuilder<U,R>
StreamingHttpClient instances which have a capacity to call any server based on the parsed
absolute-form URL address information from each StreamingHttpRequest.
It also provides a good set of default settings and configurations, which could be used by most users as-is or could be overridden to address specific use cases.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
MultiAddressHttpClientBuilder.SingleAddressInitializer<U,R>
Initializes the
SingleAddressHttpClientBuilder for each new client. |
| Modifier and Type | Method and Description |
|---|---|
MultiAddressHttpClientBuilder<U,R> |
bufferAllocator(BufferAllocator allocator)
Sets the
BufferAllocator for all clients created from this builder. |
default HttpClient |
build()
Builds a new
HttpClient. |
default BlockingHttpClient |
buildBlocking()
Creates a new
BlockingHttpClient. |
default BlockingStreamingHttpClient |
buildBlockingStreaming()
Creates a new
BlockingStreamingHttpClient. |
StreamingHttpClient |
buildStreaming()
Builds a new
StreamingHttpClient. |
MultiAddressHttpClientBuilder<U,R> |
executionStrategy(HttpExecutionStrategy strategy)
Sets the
HttpExecutionStrategy to be used for client callbacks when executing client requests for all
clients created from this builder. |
MultiAddressHttpClientBuilder<U,R> |
executor(Executor executor)
Sets the
Executor for all clients created from this builder. |
MultiAddressHttpClientBuilder<U,R> |
followRedirects(RedirectConfig config)
Enables redirection.
|
default MultiAddressHttpClientBuilder<U,R> |
headersFactory(HttpHeadersFactory headersFactory)
Sets the
HttpHeadersFactory to be used for creating HttpHeaders for new requests. |
MultiAddressHttpClientBuilder<U,R> |
initializer(MultiAddressHttpClientBuilder.SingleAddressInitializer<U,R> initializer)
Set a function which can customize options for each
StreamingHttpClient that is built. |
MultiAddressHttpClientBuilder<U,R> |
ioExecutor(IoExecutor ioExecutor)
Sets the
IoExecutor for all clients created from this builder. |
MultiAddressHttpClientBuilder<U,R> ioExecutor(IoExecutor ioExecutor)
IoExecutor for all clients created from this builder.ioExecutor - IoExecutor to use.this.MultiAddressHttpClientBuilder<U,R> executor(Executor executor)
Executor for all clients created from this builder.executor - IoExecutor to use.this.MultiAddressHttpClientBuilder<U,R> executionStrategy(HttpExecutionStrategy strategy)
HttpExecutionStrategy to be used for client callbacks when executing client requests for all
clients created from this builder.
Provides the base execution strategy for all clients created from this builder and the default strategy for
the SingleAddressHttpClientBuilder used to construct client instances. The
initializer(SingleAddressInitializer) may be used for some customization of the execution strategy for a
specific single address client instance, but may not reduce the offloading to be performed. Specifically, the
initializer may introduce additional offloading via
SingleAddressHttpClientBuilder.executionStrategy(HttpExecutionStrategy) and may add filters which
influence the computed execution strategy.
Specifying an execution strategy will affect the offloading used during the execution of client requests:
HttpExecutionStrategies.defaultStrategy()
SingleAddressHttpClientBuilder instances generated will also have default strategy.
HttpExecutionStrategies.offloadNone()
(or deprecated HttpExecutionStrategies.offloadNever())
SingleAddressHttpClientBuilder instances created by the client will have a strategy of
HttpExecutionStrategies.offloadNone(). HttpExecutionStrategies.offloadNone() execution
strategy requires that filters and asynchronous callbacks
must not ever block during the execution of client
requests. An initializer may override to add offloads using
SingleAddressHttpClientBuilder.executionStrategy(HttpExecutionStrategy).
HttpExecutionStrategies.customStrategyBuilder()) or
HttpExecutionStrategies.offloadAll()
SingleAddressHttpClientBuilder instances created by the client will start with the provided
strategy and may add additional offloading as required by added filters.
strategy - HttpExecutionStrategy to use. If callbacks to the application code may block then those
callbacks must request to be offloaded.this.HttpExecutionStrategiesMultiAddressHttpClientBuilder<U,R> bufferAllocator(BufferAllocator allocator)
BufferAllocator for all clients created from this builder.allocator - BufferAllocator to use.this.default MultiAddressHttpClientBuilder<U,R> headersFactory(HttpHeadersFactory headersFactory)
HttpHeadersFactory to be used for creating HttpHeaders for new requests.headersFactory - HttpHeadersFactory to be used for creating HttpHeaders for new requeststhisMultiAddressHttpClientBuilder<U,R> initializer(MultiAddressHttpClientBuilder.SingleAddressInitializer<U,R> initializer)
StreamingHttpClient that is built.initializer - Initializes the SingleAddressHttpClientBuilder used to build new
StreamingHttpClients. See executionStrategy(HttpExecutionStrategy) for discussion of
restrictions on the use of SingleAddressHttpClientBuilder.executionStrategy(HttpExecutionStrategy)
within an initializer.thisMultiAddressHttpClientBuilder<U,R> followRedirects(RedirectConfig config)
config - RedirectConfig to configure redirection behavior. It can be used to tune what requests
should follow redirects and which parts of the original request (headers/payload body/trailers) should be
redirected to non-relative locations.this.RedirectConfigBuilderStreamingHttpClient buildStreaming()
StreamingHttpClient.StreamingHttpClientIllegalArgumentException - for incomplete or illegal configurationsIllegalStateException - for unsupported configuration combinationsdefault HttpClient build()
HttpClient.HttpClientdefault BlockingStreamingHttpClient buildBlockingStreaming()
BlockingStreamingHttpClient.BlockingStreamingHttpClientdefault BlockingHttpClient buildBlocking()
BlockingHttpClient.BlockingHttpClient