Class HttpComponentsClientHttpRequestFactoryBuilder
java.lang.Object
org.springframework.boot.http.client.HttpComponentsClientHttpRequestFactoryBuilder
- All Implemented Interfaces:
ClientHttpRequestFactoryBuilder<org.springframework.http.client.HttpComponentsClientHttpRequestFactory>
Builder for
ClientHttpRequestFactoryBuilder.httpComponents()
.- Since:
- 3.4.0
-
Method Summary
Modifier and TypeMethodDescriptionfinal org.springframework.http.client.HttpComponentsClientHttpRequestFactory
build
(ClientHttpRequestFactorySettings settings) Build a fully configuredClientHttpRequestFactory
, applying the givensettings
if they are provided.protected org.springframework.http.client.HttpComponentsClientHttpRequestFactory
protected static <T> Consumer<T>
protected final List<Consumer<org.springframework.http.client.HttpComponentsClientHttpRequestFactory>>
protected final List<Consumer<org.springframework.http.client.HttpComponentsClientHttpRequestFactory>>
mergedCustomizers
(Collection<Consumer<org.springframework.http.client.HttpComponentsClientHttpRequestFactory>> customizers) protected final List<Consumer<org.springframework.http.client.HttpComponentsClientHttpRequestFactory>>
mergedCustomizers
(Consumer<org.springframework.http.client.HttpComponentsClientHttpRequestFactory> customizer) withConnectionManagerCustomizer
(Consumer<org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder> connectionManagerCustomizer) Return a newHttpComponentsClientHttpRequestFactoryBuilder
that applies additional customization to the underlyingPoolingHttpClientConnectionManagerBuilder
.withCustomizer
(Consumer<org.springframework.http.client.HttpComponentsClientHttpRequestFactory> customizer) Return a newClientHttpRequestFactoryBuilder
that applies the given customizer to theClientHttpRequestFactory
after it has been built.withCustomizers
(Collection<Consumer<org.springframework.http.client.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<org.springframework.http.client.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<org.springframework.http.client.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 org.springframework.http.client.HttpComponentsClientHttpRequestFactory createClientHttpRequestFactory(ClientHttpRequestFactorySettings settings) -
emptyCustomizer
-
getCustomizers
-
mergedCustomizers
-
mergedCustomizers
protected final List<Consumer<org.springframework.http.client.HttpComponentsClientHttpRequestFactory>> mergedCustomizers(Collection<Consumer<org.springframework.http.client.HttpComponentsClientHttpRequestFactory>> customizers) -
build
public final org.springframework.http.client.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 org.springframework.http.client.ClientHttpRequestFactory>
- Parameters:
settings
- the settings to apply ornull
- Returns:
- a fully configured
ClientHttpRequestFactory
.
-