Class DefaultHttpClientFactory

java.lang.Object
com.sap.cloud.sdk.cloudplatform.connectivity.AbstractHttpClientFactory
com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpClientFactory
All Implemented Interfaces:
HttpClientFactory

public class DefaultHttpClientFactory extends AbstractHttpClientFactory
Default implementation of HttpClientFactory.
  • Constructor Details

    • DefaultHttpClientFactory

      public DefaultHttpClientFactory()
  • Method Details

    • getRequestConfigBuilder

      @Nonnull protected org.apache.http.client.config.RequestConfig.Builder getRequestConfigBuilder(@Nullable HttpDestinationProperties destination)
      Description copied from class: AbstractHttpClientFactory
      Get the request configuration builder for the HTTP client builder.
      Overrides:
      getRequestConfigBuilder in class AbstractHttpClientFactory
      Parameters:
      destination - The optional destination reference.
      Returns:
      A request configuration builder reference.
    • getSocketConfigBuilder

      @Nonnull protected org.apache.http.config.SocketConfig.Builder getSocketConfigBuilder(@Nullable HttpDestinationProperties destination)
      Description copied from class: AbstractHttpClientFactory
      Get the socket configuration builder for the HTTP client builder.
      Overrides:
      getSocketConfigBuilder in class AbstractHttpClientFactory
      Parameters:
      destination - The optional destination reference.
      Returns:
      A socket configuration builder reference.
    • getConnectionManager

      @Nonnull protected org.apache.http.impl.conn.PoolingHttpClientConnectionManager getConnectionManager(@Nullable HttpDestinationProperties destination) throws GeneralSecurityException, IOException
      Description copied from class: AbstractHttpClientFactory
      Get the connection manager for the HTTP client builder.

      Note: Since the destination may have custom TLS/SSL settings, the returned connection manager shall not be cached or reused. As a result the cardinality is: One HttpClient to one HttpClientConnectionManager.

      Overrides:
      getConnectionManager in class AbstractHttpClientFactory
      Parameters:
      destination - The optional destination reference.
      Returns:
      An optional connection manager instance.
      Throws:
      GeneralSecurityException - If trust store or key store could not be loaded.
      IOException - If trust store or key store could not be loaded.
    • builder

    • getTimeoutMilliseconds

      protected int getTimeoutMilliseconds()
      The timeout threshold.
    • getMaxConnectionsPerRoute

      protected int getMaxConnectionsPerRoute()
      The maximum number of connections per route.
    • getMaxConnectionsTotal

      protected int getMaxConnectionsTotal()
      The maximum number of connections in total.