Class DefaultHttpClientFactory
java.lang.Object
com.sap.cloud.sdk.cloudplatform.connectivity.AbstractHttpClientFactory
com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpClientFactory
- All Implemented Interfaces:
HttpClientFactory
Default implementation of
HttpClientFactory
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
protected org.apache.http.impl.conn.PoolingHttpClientConnectionManager
getConnectionManager
(HttpDestinationProperties destination) Get the connection manager for the HTTP client builder.protected int
The maximum number of connections per route.protected int
The maximum number of connections in total.protected org.apache.http.client.config.RequestConfig.Builder
getRequestConfigBuilder
(HttpDestinationProperties destination) Get the request configuration builder for the HTTP client builder.protected org.apache.http.config.SocketConfig.Builder
getSocketConfigBuilder
(HttpDestinationProperties destination) Get the socket configuration builder for the HTTP client builder.protected int
The timeout threshold.Methods inherited from class com.sap.cloud.sdk.cloudplatform.connectivity.AbstractHttpClientFactory
createHttpClient, getHttpClientBuilder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.sap.cloud.sdk.cloudplatform.connectivity.HttpClientFactory
createHttpClient
-
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 classAbstractHttpClientFactory
- 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 classAbstractHttpClientFactory
- 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 oneHttpClientConnectionManager
.- Overrides:
getConnectionManager
in classAbstractHttpClientFactory
- 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.
-