Package io.servicetalk.http.api
Class DelegatingMultiAddressHttpClientBuilder<U,R>
java.lang.Object
io.servicetalk.http.api.DelegatingMultiAddressHttpClientBuilder<U,R>
- Type Parameters:
U
- the type of address before resolution (unresolved address)R
- the type of address after resolution (resolved address)
- All Implemented Interfaces:
MultiAddressHttpClientBuilder<U,
R>
public class DelegatingMultiAddressHttpClientBuilder<U,R>
extends Object
implements MultiAddressHttpClientBuilder<U,R>
A
MultiAddressHttpClientBuilder
that delegates all methods to another MultiAddressHttpClientBuilder
.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.servicetalk.http.api.MultiAddressHttpClientBuilder
MultiAddressHttpClientBuilder.SingleAddressInitializer<U,
R> -
Constructor Summary
ConstructorDescriptionCreate a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbufferAllocator
(BufferAllocator allocator) build()
defaultHttpPort
(int port) Configures the default port for the HTTP scheme if not explicitly provided as part of theHttpRequestMetaData.requestTarget()
.defaultHttpsPort
(int port) Configures the default port for the HTTPS scheme if not explicitly provided as part of theHttpRequestMetaData.requestTarget()
.protected final MultiAddressHttpClientBuilder<U,
R> delegate()
Returns theMultiAddressHttpClientBuilder
delegate.executionStrategy
(HttpExecutionStrategy strategy) Sets theHttpExecutionStrategy
to be used for client callbacks when executing client requests for all clients created from this builder.followRedirects
(RedirectConfig config) Configures redirection behavior.headersFactory
(HttpHeadersFactory headersFactory) Sets theHttpHeadersFactory
to be used for creatingHttpHeaders
for new requests.initializer
(MultiAddressHttpClientBuilder.SingleAddressInitializer<U, R> initializer) Set a function which can customize options for eachStreamingHttpClient
that is built.ioExecutor
(IoExecutor ioExecutor) toString()
-
Constructor Details
-
DelegatingMultiAddressHttpClientBuilder
Create a new instance.- Parameters:
delegate
-MultiAddressHttpClientBuilder
to which all methods are delegated.
-
-
Method Details
-
delegate
Returns theMultiAddressHttpClientBuilder
delegate.- Returns:
- Delegate
MultiAddressHttpClientBuilder
.
-
toString
-
ioExecutor
- Specified by:
ioExecutor
in interfaceMultiAddressHttpClientBuilder<U,
R>
-
executor
- Specified by:
executor
in interfaceMultiAddressHttpClientBuilder<U,
R>
-
executionStrategy
Description copied from interface:MultiAddressHttpClientBuilder
Sets theHttpExecutionStrategy
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. TheMultiAddressHttpClientBuilder.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 viaSingleAddressHttpClientBuilder.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:
- Unspecified or
HttpExecutionStrategies.defaultStrategy()
- The resulting client instances will use the default safe strategy for each API variant and
SingleAddressHttpClientBuilder
instances generated will also have default strategy. HttpExecutionStrategies.offloadNone()
(or deprecatedHttpExecutionStrategies.offloadNever()
)SingleAddressHttpClientBuilder
instances created by the client will have a strategy ofHttpExecutionStrategies.offloadNone()
.HttpExecutionStrategies.offloadNone()
execution strategy requires that filters and asynchronous callbacks must not ever block during the execution of client requests. Aninitializer
may override to add offloads usingSingleAddressHttpClientBuilder.executionStrategy(HttpExecutionStrategy)
.- A custom execution strategy (
HttpExecutionStrategies.customStrategyBuilder()
) orHttpExecutionStrategies.offloadAll()
SingleAddressHttpClientBuilder
instances created by the client will start with the provided strategy and may add additional offloading as required by added filters.
- Specified by:
executionStrategy
in interfaceMultiAddressHttpClientBuilder<U,
R> - Parameters:
strategy
-HttpExecutionStrategy
to use. If callbacks to the application code may block then those callbacks must request to be offloaded.- Returns:
this
.- See Also:
- Unspecified or
-
bufferAllocator
- Specified by:
bufferAllocator
in interfaceMultiAddressHttpClientBuilder<U,
R>
-
headersFactory
Description copied from interface:MultiAddressHttpClientBuilder
Sets theHttpHeadersFactory
to be used for creatingHttpHeaders
for new requests.- Specified by:
headersFactory
in interfaceMultiAddressHttpClientBuilder<U,
R> - Parameters:
headersFactory
-HttpHeadersFactory
to be used for creatingHttpHeaders
for new requests- Returns:
this
-
initializer
public MultiAddressHttpClientBuilder<U,R> initializer(MultiAddressHttpClientBuilder.SingleAddressInitializer<U, R> initializer) Description copied from interface:MultiAddressHttpClientBuilder
Set a function which can customize options for eachStreamingHttpClient
that is built.- Specified by:
initializer
in interfaceMultiAddressHttpClientBuilder<U,
R> - Parameters:
initializer
- Initializes theSingleAddressHttpClientBuilder
used to build newStreamingHttpClient
s. SeeMultiAddressHttpClientBuilder.executionStrategy(HttpExecutionStrategy)
for discussion of restrictions on the use ofSingleAddressHttpClientBuilder.executionStrategy(HttpExecutionStrategy)
within an initializer.- Returns:
this
-
followRedirects
Description copied from interface:MultiAddressHttpClientBuilder
Configures redirection behavior.- Specified by:
followRedirects
in interfaceMultiAddressHttpClientBuilder<U,
R> - Parameters:
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. Usenull
to disable redirects.- Returns:
this
.- See Also:
-
defaultHttpPort
Description copied from interface:MultiAddressHttpClientBuilder
Configures the default port for the HTTP scheme if not explicitly provided as part of theHttpRequestMetaData.requestTarget()
.- Specified by:
defaultHttpPort
in interfaceMultiAddressHttpClientBuilder<U,
R> - Parameters:
port
- the port that should be used if not explicitly provided for HTTP requests.- Returns:
this
.
-
defaultHttpsPort
Description copied from interface:MultiAddressHttpClientBuilder
Configures the default port for the HTTPS scheme if not explicitly provided as part of theHttpRequestMetaData.requestTarget()
.- Specified by:
defaultHttpsPort
in interfaceMultiAddressHttpClientBuilder<U,
R> - Parameters:
port
- the port that should be used if not explicitly provided for HTTPS requests.- Returns:
this
.
-
build
-
buildStreaming
-
buildBlocking
-
buildBlockingStreaming
-