Class ApacheHttpClient5FactoryBuilder
java.lang.Object
com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5FactoryBuilder
Builder class for a default implementation of the
ApacheHttpClient5Factory
interface.- Since:
- 4.20.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enum to control the automatic TLS upgrade feature for insecure connections. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newApacheHttpClient5Factory
instance with the previously configured parameters.maxConnectionsPerRoute
(int maxConnectionsPerRoute) Sets the maximum number of parallel connections per route (e.g. per remote host) that can be established with aHttpClient
created by the to-be-builtApacheHttpClient5Factory
.maxConnectionsTotal
(int maxConnectionsTotal) Sets the maximum number of parallel connections that can be established with aHttpClient
created by the to-be-builtApacheHttpClient5Factory
.Sets the timeoutHttpClient
instances created by the to-be-builtApacheHttpClient5Factory
should use.timeoutInMilliseconds
(int timeoutInMilliseconds) Sets the timeoutHttpClient
instances created by the to-be-builtApacheHttpClient5Factory
should use.tlsUpgrade
(ApacheHttpClient5FactoryBuilder.TlsUpgrade tlsUpgrade) Sets the automatic TLS upgrade strategy.
-
Constructor Details
-
ApacheHttpClient5FactoryBuilder
public ApacheHttpClient5FactoryBuilder()
-
-
Method Details
-
timeoutInMilliseconds
Sets the timeoutHttpClient
instances created by the to-be-builtApacheHttpClient5Factory
should use. This timeout applies to the following concerns:- Connection timeout: The time to establish the connection with the remote host.
- Socket timeout: The time to wait for data – after the connection was established; maximum time of inactivity between two data packets.
- Connection Request timeout: The time to wait when requesting a connection lease from the underlying
PoolingHttpClientConnectionManager
.
This is an optional parameter. By default, the timeout is set to 2 minutes.
- Parameters:
timeoutInMilliseconds
- The timeout in milliseconds.- Returns:
- This builder.
-
timeout
Sets the timeoutHttpClient
instances created by the to-be-builtApacheHttpClient5Factory
should use. This timeout applies to the following concerns:- Connection timeout: The time to establish the connection with the remote host.
- Socket timeout: The time to wait for data – after the connection was established; maximum time of inactivity between two data packets.
- Connection Request timeout: The time to wait when requesting a connection lease from the underlying
PoolingHttpClientConnectionManager
.
This is an optional parameter. By default, the timeout is set to 2 minutes.
- Parameters:
timeout
- The timeout to use.- Returns:
- This builder.
-
maxConnectionsTotal
Sets the maximum number of parallel connections that can be established with aHttpClient
created by the to-be-builtApacheHttpClient5Factory
.This is an optional parameter. By default, the maximum number of parallel connections is set to 200.
- Parameters:
maxConnectionsTotal
- The maximum number of parallel connections.- Returns:
- This builder.
-
tlsUpgrade
@Nonnull public ApacheHttpClient5FactoryBuilder tlsUpgrade(@Nonnull ApacheHttpClient5FactoryBuilder.TlsUpgrade tlsUpgrade) Sets the automatic TLS upgrade strategy. This strategy controls whether insecure connections should be automatically upgraded.- Since:
- 5.14.0
-
maxConnectionsPerRoute
Sets the maximum number of parallel connections per route (e.g. per remote host) that can be established with aHttpClient
created by the to-be-builtApacheHttpClient5Factory
.This is an optional parameter. By default, the maximum number of parallel connections per route is set to 100.
- Parameters:
maxConnectionsPerRoute
- The maximum number of parallel connections per route.- Returns:
- This builder.
-
build
Builds a newApacheHttpClient5Factory
instance with the previously configured parameters.- Returns:
- A new
ApacheHttpClient5Factory
instance.
-