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
Nested ClassesModifier and TypeClassDescriptionstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()protected org.apache.http.impl.conn.PoolingHttpClientConnectionManagergetConnectionManager(HttpDestinationProperties destination) Get the connection manager for the HTTP client builder.protected intThe maximum number of connections per route.protected intThe maximum number of connections in total.protected org.apache.http.client.config.RequestConfig.BuildergetRequestConfigBuilder(HttpDestinationProperties destination) Get the request configuration builder for the HTTP client builder.protected org.apache.http.config.SocketConfig.BuildergetSocketConfigBuilder(HttpDestinationProperties destination) Get the socket configuration builder for the HTTP client builder.protected intThe timeout threshold.Methods inherited from class com.sap.cloud.sdk.cloudplatform.connectivity.AbstractHttpClientFactory
createHttpClient, getHttpClientBuilderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:AbstractHttpClientFactoryGet the request configuration builder for the HTTP client builder.- Overrides:
getRequestConfigBuilderin 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:AbstractHttpClientFactoryGet the socket configuration builder for the HTTP client builder.- Overrides:
getSocketConfigBuilderin 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:AbstractHttpClientFactoryGet 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
HttpClientto oneHttpClientConnectionManager.- Overrides:
getConnectionManagerin 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.
-