Class ApacheHttpClient5FactoryBuilder

java.lang.Object
com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5FactoryBuilder

public class ApacheHttpClient5FactoryBuilder extends Object
Builder class for a default implementation of the ApacheHttpClient5Factory interface.
Since:
4.20.0
  • Constructor Details

    • ApacheHttpClient5FactoryBuilder

      public ApacheHttpClient5FactoryBuilder()
  • Method Details

    • timeoutInMilliseconds

      @Nonnull public ApacheHttpClient5FactoryBuilder timeoutInMilliseconds(int timeoutInMilliseconds)
      Sets the timeout HttpClient instances created by the to-be-built ApacheHttpClient5Factory 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

      @Nonnull public ApacheHttpClient5FactoryBuilder timeout(@Nonnull Duration timeout)
      Sets the timeout HttpClient instances created by the to-be-built ApacheHttpClient5Factory 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

      @Nonnull public ApacheHttpClient5FactoryBuilder maxConnectionsTotal(int maxConnectionsTotal)
      Sets the maximum number of parallel connections that can be established with a HttpClient created by the to-be-built ApacheHttpClient5Factory.

      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

      @Beta @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

      @Nonnull public ApacheHttpClient5FactoryBuilder maxConnectionsPerRoute(int maxConnectionsPerRoute)
      Sets the maximum number of parallel connections per route (e.g. per remote host) that can be established with a HttpClient created by the to-be-built ApacheHttpClient5Factory.

      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

      @Nonnull public ApacheHttpClient5Factory build()
      Builds a new ApacheHttpClient5Factory instance with the previously configured parameters.
      Returns:
      A new ApacheHttpClient5Factory instance.