U - the type of address before resolution (unresolved address)R - the type of address after resolution (resolved address)public class DelegatingMultiAddressHttpClientBuilder<U,R> extends Object implements MultiAddressHttpClientBuilder<U,R>
MultiAddressHttpClientBuilder that delegates all methods to another MultiAddressHttpClientBuilder.MultiAddressHttpClientBuilder.SingleAddressInitializer<U,R>| Constructor and Description |
|---|
DelegatingMultiAddressHttpClientBuilder(MultiAddressHttpClientBuilder<U,R> delegate)
Create a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
MultiAddressHttpClientBuilder<U,R> |
bufferAllocator(BufferAllocator allocator)
Sets the
BufferAllocator for all clients created from this builder. |
HttpClient |
build()
Builds a new
HttpClient. |
BlockingHttpClient |
buildBlocking()
Creates a new
BlockingHttpClient. |
BlockingStreamingHttpClient |
buildBlockingStreaming()
Creates a new
BlockingStreamingHttpClient. |
StreamingHttpClient |
buildStreaming()
Builds a new
StreamingHttpClient. |
MultiAddressHttpClientBuilder<U,R> |
defaultHttpPort(int port)
Configures the default port for the HTTP scheme if not explicitly provided as part of the
HttpRequestMetaData.requestTarget(). |
MultiAddressHttpClientBuilder<U,R> |
defaultHttpsPort(int port)
Configures the default port for the HTTPS scheme if not explicitly provided as part of the
HttpRequestMetaData.requestTarget(). |
protected MultiAddressHttpClientBuilder<U,R> |
delegate()
Returns the
MultiAddressHttpClientBuilder delegate. |
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)
Configures redirection behavior.
|
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. |
String |
toString() |
public DelegatingMultiAddressHttpClientBuilder(MultiAddressHttpClientBuilder<U,R> delegate)
delegate - MultiAddressHttpClientBuilder to which all methods are delegated.protected final MultiAddressHttpClientBuilder<U,R> delegate()
MultiAddressHttpClientBuilder delegate.MultiAddressHttpClientBuilder.public String toString()
toString in class Objectpublic MultiAddressHttpClientBuilder<U,R> ioExecutor(IoExecutor ioExecutor)
IoExecutor for all clients created from this builder.ioExecutor in interface MultiAddressHttpClientBuilder<U,R>ioExecutor - IoExecutor to use.this.public MultiAddressHttpClientBuilder<U,R> executor(Executor executor)
Executor for all clients created from this builder.executor in interface MultiAddressHttpClientBuilder<U,R>executor - IoExecutor to use.this.public MultiAddressHttpClientBuilder<U,R> executionStrategy(HttpExecutionStrategy strategy)
MultiAddressHttpClientBuilderHttpExecutionStrategy 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
MultiAddressHttpClientBuilder.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.
executionStrategy in interface MultiAddressHttpClientBuilder<U,R>strategy - HttpExecutionStrategy to use. If callbacks to the application code may block then those
callbacks must request to be offloaded.this.HttpExecutionStrategiespublic MultiAddressHttpClientBuilder<U,R> bufferAllocator(BufferAllocator allocator)
BufferAllocator for all clients created from this builder.bufferAllocator in interface MultiAddressHttpClientBuilder<U,R>allocator - BufferAllocator to use.this.public MultiAddressHttpClientBuilder<U,R> headersFactory(HttpHeadersFactory headersFactory)
MultiAddressHttpClientBuilderHttpHeadersFactory to be used for creating HttpHeaders for new requests.headersFactory in interface MultiAddressHttpClientBuilder<U,R>headersFactory - HttpHeadersFactory to be used for creating HttpHeaders for new requeststhispublic MultiAddressHttpClientBuilder<U,R> initializer(MultiAddressHttpClientBuilder.SingleAddressInitializer<U,R> initializer)
MultiAddressHttpClientBuilderStreamingHttpClient that is built.initializer in interface MultiAddressHttpClientBuilder<U,R>initializer - Initializes the SingleAddressHttpClientBuilder used to build new
StreamingHttpClients. See MultiAddressHttpClientBuilder.executionStrategy(HttpExecutionStrategy) for discussion of
restrictions on the use of SingleAddressHttpClientBuilder.executionStrategy(HttpExecutionStrategy)
within an initializer.thispublic MultiAddressHttpClientBuilder<U,R> followRedirects(RedirectConfig config)
MultiAddressHttpClientBuilderfollowRedirects in interface MultiAddressHttpClientBuilder<U,R>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. Use null to disable redirects.this.RedirectConfigBuilderpublic MultiAddressHttpClientBuilder<U,R> defaultHttpPort(int port)
MultiAddressHttpClientBuilderHttpRequestMetaData.requestTarget().defaultHttpPort in interface MultiAddressHttpClientBuilder<U,R>port - the port that should be used if not explicitly provided for HTTP requests.this.public MultiAddressHttpClientBuilder<U,R> defaultHttpsPort(int port)
MultiAddressHttpClientBuilderHttpRequestMetaData.requestTarget().defaultHttpsPort in interface MultiAddressHttpClientBuilder<U,R>port - the port that should be used if not explicitly provided for HTTPS requests.this.public HttpClient build()
HttpClient.HttpClientpublic StreamingHttpClient buildStreaming()
StreamingHttpClient.StreamingHttpClientpublic BlockingHttpClient buildBlocking()
BlockingHttpClient.BlockingHttpClientpublic BlockingStreamingHttpClient buildBlockingStreaming()
BlockingStreamingHttpClient.BlockingStreamingHttpClient