Class DefaultHttpClientFactory

java.lang.Object
com.sap.cloud.security.client.DefaultHttpClientFactory
All Implemented Interfaces:
HttpClientFactory

public class DefaultHttpClientFactory extends Object implements HttpClientFactory
Constructs a CloseableHttpClient object. Facilitates certificate and client credentials-based communication based on the identity service configuration from the binding.

HttpClient is configured with the following default values: - connection and connection request timeout - 5 s - socket timeout - 30 s - max connections - 200 - max connections per route - 20

If these values do not meet your requirements, please provide your own implementation of HttpClientFactory.

  • Constructor Details

    • DefaultHttpClientFactory

      public DefaultHttpClientFactory()
  • Method Details

    • createClient

      public org.apache.http.impl.client.CloseableHttpClient createClient(ClientIdentity clientIdentity) throws HttpClientException
      Description copied from interface: HttpClientFactory
      Provides CloseableHttpClient based on ClientIdentity details. For ClientIdentity that is certificate based it will resolve https client using the provided ClientIdentity, if the ClientIdentity wasn't provided it will return default HttpClient.
      Specified by:
      createClient in interface HttpClientFactory
      Parameters:
      clientIdentity - for X.509 certificate based communication ClientCertificate implementation of ClientIdentity interface should be provided
      Returns:
      HTTP or HTTPS client
      Throws:
      HttpClientException - in case HTTPS Client could not be setup