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
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum to control the automatic TLS upgrade feature for insecure connections. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newApacheHttpClient5Factoryinstance 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 aHttpClientcreated by the to-be-builtApacheHttpClient5Factory.maxConnectionsTotal(int maxConnectionsTotal) Sets the maximum number of parallel connections that can be established with aHttpClientcreated by the to-be-builtApacheHttpClient5Factory.Sets the timeoutHttpClientinstances created by the to-be-builtApacheHttpClient5Factoryshould use.timeoutInMilliseconds(int timeoutInMilliseconds) Sets the timeoutHttpClientinstances created by the to-be-builtApacheHttpClient5Factoryshould use.tlsUpgrade(ApacheHttpClient5FactoryBuilder.TlsUpgrade tlsUpgrade) Sets theUpgradeheader.
-
Constructor Details
-
ApacheHttpClient5FactoryBuilder
public ApacheHttpClient5FactoryBuilder()
-
-
Method Details
-
timeoutInMilliseconds
Sets the timeoutHttpClientinstances created by the to-be-builtApacheHttpClient5Factoryshould 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 timeoutHttpClientinstances created by the to-be-builtApacheHttpClient5Factoryshould 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 aHttpClientcreated 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 theUpgradeheader. OnlyProxyType.INTERNEThas theUpgradeheader by default.ApacheHttpClient5FactoryBuilder.TlsUpgrade.DISABLEDonly works forProxyType.INTERNETApacheHttpClient5FactoryBuilder.TlsUpgrade.ENABLEDonly works forProxyType.ON_PREMISE- Since:
- 5.14.0
-
maxConnectionsPerRoute
Sets the maximum number of parallel connections per route (e.g. per remote host) that can be established with aHttpClientcreated 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 newApacheHttpClient5Factoryinstance with the previously configured parameters.- Returns:
- A new
ApacheHttpClient5Factoryinstance.
-