Package com.sap.cloud.security.client
Class DefaultHttpClientFactory
java.lang.Object
com.sap.cloud.security.client.DefaultHttpClientFactory
- All Implemented Interfaces:
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.
-
Field Summary
Fields inherited from interface com.sap.cloud.security.client.HttpClientFactory
DEFAULT_HTTP_CLIENT_FACTORY, services -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.http.impl.client.CloseableHttpClientcreateClient(ClientIdentity clientIdentity) Provides CloseableHttpClient based on ClientIdentity details.
-
Constructor Details
-
DefaultHttpClientFactory
public DefaultHttpClientFactory()
-
-
Method Details
-
createClient
public org.apache.http.impl.client.CloseableHttpClient createClient(ClientIdentity clientIdentity) throws HttpClientException Description copied from interface:HttpClientFactoryProvides 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:
createClientin interfaceHttpClientFactory- Parameters:
clientIdentity- for X.509 certificate based communicationClientCertificateimplementation of ClientIdentity interface should be provided- Returns:
- HTTP or HTTPS client
- Throws:
HttpClientException- in case HTTPS Client could not be setup
-