Class HttpComponentsClientHttpRequestFactoryBuilder
java.lang.Object
org.springframework.boot.http.client.HttpComponentsClientHttpRequestFactoryBuilder
- All Implemented Interfaces:
ClientHttpRequestFactoryBuilder<HttpComponentsClientHttpRequestFactory>
Builder for
ClientHttpRequestFactoryBuilder.httpComponents()
.- Since:
- 3.4.0
- Author:
- Phillip Webb, Andy Wilkinson, Scott Frederick
-
Method Summary
Modifier and TypeMethodDescriptionbuild
(ClientHttpRequestFactorySettings settings) Build a fully configuredClientHttpRequestFactory
, applying the givensettings
if they are provided.protected HttpComponentsClientHttpRequestFactory
protected static <T> Consumer<T>
protected final List<Consumer<HttpComponentsClientHttpRequestFactory>>
protected final List<Consumer<HttpComponentsClientHttpRequestFactory>>
protected final List<Consumer<HttpComponentsClientHttpRequestFactory>>
withConnectionManagerCustomizer
(Consumer<org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder> connectionManagerCustomizer) Return a newHttpComponentsClientHttpRequestFactoryBuilder
that applies additional customization to the underlyingPoolingHttpClientConnectionManagerBuilder
.withCustomizer
(Consumer<HttpComponentsClientHttpRequestFactory> customizer) Return a newClientHttpRequestFactoryBuilder
that applies the given customizer to theClientHttpRequestFactory
after it has been built.withCustomizers
(Collection<Consumer<HttpComponentsClientHttpRequestFactory>> customizers) Return a newClientHttpRequestFactoryBuilder
that applies the given customizers to theClientHttpRequestFactory
after it has been built.withDefaultRequestConfigCustomizer
(Consumer<org.apache.hc.client5.http.config.RequestConfig.Builder> defaultRequestConfigCustomizer) Return a newHttpComponentsClientHttpRequestFactoryBuilder
that applies additional customization to the underlyingRequestConfig.Builder
used for default requests.withHttpClientCustomizer
(Consumer<org.apache.hc.client5.http.impl.classic.HttpClientBuilder> httpClientCustomizer) Return a newHttpComponentsClientHttpRequestFactoryBuilder
that applies additional customization to the underlyingHttpClientBuilder
.withSocketConfigCustomizer
(Consumer<org.apache.hc.core5.http.io.SocketConfig.Builder> socketConfigCustomizer) Return a newHttpComponentsClientHttpRequestFactoryBuilder
that applies additional customization to the underlyingSocketConfig.Builder
.withTlsSocketStrategyFactory
(Function<SslBundle, org.apache.hc.client5.http.ssl.TlsSocketStrategy> tlsSocketStrategyFactory) Return a newHttpComponentsClientHttpRequestFactoryBuilder
with a replacementTlsSocketStrategy
factory.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder
build
-
Method Details
-
withCustomizer
public HttpComponentsClientHttpRequestFactoryBuilder withCustomizer(Consumer<HttpComponentsClientHttpRequestFactory> customizer) Description copied from interface:ClientHttpRequestFactoryBuilder
Return a newClientHttpRequestFactoryBuilder
that applies the given customizer to theClientHttpRequestFactory
after it has been built.- Parameters:
customizer
- the customizers to apply- Returns:
- a new
ClientHttpRequestFactoryBuilder
instance
-
withCustomizers
public HttpComponentsClientHttpRequestFactoryBuilder withCustomizers(Collection<Consumer<HttpComponentsClientHttpRequestFactory>> customizers) Description copied from interface:ClientHttpRequestFactoryBuilder
Return a newClientHttpRequestFactoryBuilder
that applies the given customizers to theClientHttpRequestFactory
after it has been built.- Parameters:
customizers
- the customizers to apply- Returns:
- a new
ClientHttpRequestFactoryBuilder
instance
-
withHttpClientCustomizer
public HttpComponentsClientHttpRequestFactoryBuilder withHttpClientCustomizer(Consumer<org.apache.hc.client5.http.impl.classic.HttpClientBuilder> httpClientCustomizer) Return a newHttpComponentsClientHttpRequestFactoryBuilder
that applies additional customization to the underlyingHttpClientBuilder
.- Parameters:
httpClientCustomizer
- the customizer to apply- Returns:
- a new
HttpComponentsClientHttpRequestFactoryBuilder
instance
-
withConnectionManagerCustomizer
public HttpComponentsClientHttpRequestFactoryBuilder withConnectionManagerCustomizer(Consumer<org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder> connectionManagerCustomizer) Return a newHttpComponentsClientHttpRequestFactoryBuilder
that applies additional customization to the underlyingPoolingHttpClientConnectionManagerBuilder
.- Parameters:
connectionManagerCustomizer
- the customizer to apply- Returns:
- a new
HttpComponentsClientHttpRequestFactoryBuilder
instance
-
withSocketConfigCustomizer
public HttpComponentsClientHttpRequestFactoryBuilder withSocketConfigCustomizer(Consumer<org.apache.hc.core5.http.io.SocketConfig.Builder> socketConfigCustomizer) Return a newHttpComponentsClientHttpRequestFactoryBuilder
that applies additional customization to the underlyingSocketConfig.Builder
.- Parameters:
socketConfigCustomizer
- the customizer to apply- Returns:
- a new
HttpComponentsClientHttpRequestFactoryBuilder
instance
-
withTlsSocketStrategyFactory
public HttpComponentsClientHttpRequestFactoryBuilder withTlsSocketStrategyFactory(Function<SslBundle, org.apache.hc.client5.http.ssl.TlsSocketStrategy> tlsSocketStrategyFactory) Return a newHttpComponentsClientHttpRequestFactoryBuilder
with a replacementTlsSocketStrategy
factory.- Parameters:
tlsSocketStrategyFactory
- the new factory used to create aTlsSocketStrategy
for a givenSslBundle
- Returns:
- a new
HttpComponentsClientHttpRequestFactoryBuilder
instance
-
withDefaultRequestConfigCustomizer
public HttpComponentsClientHttpRequestFactoryBuilder withDefaultRequestConfigCustomizer(Consumer<org.apache.hc.client5.http.config.RequestConfig.Builder> defaultRequestConfigCustomizer) Return a newHttpComponentsClientHttpRequestFactoryBuilder
that applies additional customization to the underlyingRequestConfig.Builder
used for default requests.- Parameters:
defaultRequestConfigCustomizer
- the customizer to apply- Returns:
- a new
HttpComponentsClientHttpRequestFactoryBuilder
instance
-
createClientHttpRequestFactory
protected HttpComponentsClientHttpRequestFactory createClientHttpRequestFactory(ClientHttpRequestFactorySettings settings) -
emptyCustomizer
-
getCustomizers
-
mergedCustomizers
protected final List<Consumer<HttpComponentsClientHttpRequestFactory>> mergedCustomizers(Consumer<HttpComponentsClientHttpRequestFactory> customizer) -
mergedCustomizers
protected final List<Consumer<HttpComponentsClientHttpRequestFactory>> mergedCustomizers(Collection<Consumer<HttpComponentsClientHttpRequestFactory>> customizers) -
build
public final HttpComponentsClientHttpRequestFactory build(ClientHttpRequestFactorySettings settings) Description copied from interface:ClientHttpRequestFactoryBuilder
Build a fully configuredClientHttpRequestFactory
, applying the givensettings
if they are provided.- Specified by:
build
in interfaceClientHttpRequestFactoryBuilder<T extends ClientHttpRequestFactory>
- Parameters:
settings
- the settings to apply ornull
- Returns:
- a fully configured
ClientHttpRequestFactory
.
-