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 TypeMethodDescriptionprotected final HttpClientSettingsbuild(ClientHttpRequestFactorySettings settings) Build a fully configuredClientHttpRequestFactory, applying the givensettingsif they are provided.protected HttpComponentsClientHttpRequestFactoryprotected 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 newHttpComponentsClientHttpRequestFactoryBuilderthat applies additional customization to the underlyingPoolingHttpClientConnectionManagerBuilder.withCustomizer(Consumer<HttpComponentsClientHttpRequestFactory> customizer) Return a newClientHttpRequestFactoryBuilderthat applies the given customizer to theClientHttpRequestFactoryafter it has been built.withCustomizers(Collection<Consumer<HttpComponentsClientHttpRequestFactory>> customizers) Return a newClientHttpRequestFactoryBuilderthat applies the given customizers to theClientHttpRequestFactoryafter it has been built.withDefaultRequestConfigCustomizer(Consumer<org.apache.hc.client5.http.config.RequestConfig.Builder> defaultRequestConfigCustomizer) Return a newHttpComponentsClientHttpRequestFactoryBuilderthat applies additional customization to the underlyingRequestConfig.Builderused for default requests.withHttpClientCustomizer(Consumer<org.apache.hc.client5.http.impl.classic.HttpClientBuilder> httpClientCustomizer) Return a newHttpComponentsClientHttpRequestFactoryBuilderthat applies additional customization to the underlyingHttpClientBuilder.withSocketConfigCustomizer(Consumer<org.apache.hc.core5.http.io.SocketConfig.Builder> socketConfigCustomizer) Return a newHttpComponentsClientHttpRequestFactoryBuilderthat applies additional customization to the underlyingSocketConfig.Builder.withTlsSocketStrategyFactory(Function<SslBundle, org.apache.hc.client5.http.ssl.TlsSocketStrategy> tlsSocketStrategyFactory) Return a newHttpComponentsClientHttpRequestFactoryBuilderwith a replacementTlsSocketStrategyfactory.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder
build
-
Method Details
-
withCustomizer
public HttpComponentsClientHttpRequestFactoryBuilder withCustomizer(Consumer<HttpComponentsClientHttpRequestFactory> customizer) Description copied from interface:ClientHttpRequestFactoryBuilderReturn a newClientHttpRequestFactoryBuilderthat applies the given customizer to theClientHttpRequestFactoryafter it has been built.- Parameters:
customizer- the customizers to apply- Returns:
- a new
ClientHttpRequestFactoryBuilderinstance
-
withCustomizers
public HttpComponentsClientHttpRequestFactoryBuilder withCustomizers(Collection<Consumer<HttpComponentsClientHttpRequestFactory>> customizers) Description copied from interface:ClientHttpRequestFactoryBuilderReturn a newClientHttpRequestFactoryBuilderthat applies the given customizers to theClientHttpRequestFactoryafter it has been built.- Parameters:
customizers- the customizers to apply- Returns:
- a new
ClientHttpRequestFactoryBuilderinstance
-
withHttpClientCustomizer
public HttpComponentsClientHttpRequestFactoryBuilder withHttpClientCustomizer(Consumer<org.apache.hc.client5.http.impl.classic.HttpClientBuilder> httpClientCustomizer) Return a newHttpComponentsClientHttpRequestFactoryBuilderthat applies additional customization to the underlyingHttpClientBuilder.- Parameters:
httpClientCustomizer- the customizer to apply- Returns:
- a new
HttpComponentsClientHttpRequestFactoryBuilderinstance
-
withConnectionManagerCustomizer
public HttpComponentsClientHttpRequestFactoryBuilder withConnectionManagerCustomizer(Consumer<org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder> connectionManagerCustomizer) Return a newHttpComponentsClientHttpRequestFactoryBuilderthat applies additional customization to the underlyingPoolingHttpClientConnectionManagerBuilder.- Parameters:
connectionManagerCustomizer- the customizer to apply- Returns:
- a new
HttpComponentsClientHttpRequestFactoryBuilderinstance
-
withSocketConfigCustomizer
public HttpComponentsClientHttpRequestFactoryBuilder withSocketConfigCustomizer(Consumer<org.apache.hc.core5.http.io.SocketConfig.Builder> socketConfigCustomizer) Return a newHttpComponentsClientHttpRequestFactoryBuilderthat applies additional customization to the underlyingSocketConfig.Builder.- Parameters:
socketConfigCustomizer- the customizer to apply- Returns:
- a new
HttpComponentsClientHttpRequestFactoryBuilderinstance
-
withTlsSocketStrategyFactory
public HttpComponentsClientHttpRequestFactoryBuilder withTlsSocketStrategyFactory(Function<SslBundle, org.apache.hc.client5.http.ssl.TlsSocketStrategy> tlsSocketStrategyFactory) Return a newHttpComponentsClientHttpRequestFactoryBuilderwith a replacementTlsSocketStrategyfactory.- Parameters:
tlsSocketStrategyFactory- the new factory used to create aTlsSocketStrategyfor a givenSslBundle- Returns:
- a new
HttpComponentsClientHttpRequestFactoryBuilderinstance
-
withDefaultRequestConfigCustomizer
public HttpComponentsClientHttpRequestFactoryBuilder withDefaultRequestConfigCustomizer(Consumer<org.apache.hc.client5.http.config.RequestConfig.Builder> defaultRequestConfigCustomizer) Return a newHttpComponentsClientHttpRequestFactoryBuilderthat applies additional customization to the underlyingRequestConfig.Builderused for default requests.- Parameters:
defaultRequestConfigCustomizer- the customizer to apply- Returns:
- a new
HttpComponentsClientHttpRequestFactoryBuilderinstance
-
createClientHttpRequestFactory
protected HttpComponentsClientHttpRequestFactory createClientHttpRequestFactory(ClientHttpRequestFactorySettings settings) -
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:ClientHttpRequestFactoryBuilderBuild a fully configuredClientHttpRequestFactory, applying the givensettingsif they are provided.- Specified by:
buildin interfaceClientHttpRequestFactoryBuilder<T extends ClientHttpRequestFactory>- Parameters:
settings- the settings to apply ornull- Returns:
- a fully configured
ClientHttpRequestFactory.
-
asHttpClientSettings
-