Class HttpClientPool
java.lang.Object
org.sblim.cimclient.internal.http.HttpClientPool
Class HttpClientPool implements a pool for http client connections
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
addConnectionToPool
(HttpClient httpClient) Add the connection to the pool, but does NOT add it as available connection.void
Closes the pool.protected void
finalize()
Returns the configuration context of this poolint
Returns the number of connections in this pool that are available/free for (re-)use.int
Returns the number of all connections in this pool.int
Returns poolSizeReturns the SSL context for the clients in this pool.String[]
getUpdatedCipherSuites
(String[] pCurrentCipherSuites, String pDisableCipherSuites) Returns updated array of cipher suites which is current cipher suites less any cipher suites listed to be disabled NOTE: The updated array is generated only upon first invocation and then saved, effectively making this a lazy initialization of the cipher suites on a HttpClientPool basis - it has to be done here and not in WBEMClient where it belongs because socket characteristics are not known to WBEMClientboolean
removeConnectionFromPool
(HttpClient httpClient) Removes a connection completely from the pool.retrieveAvailableConnectionFromPool
(URI pUri, AuthorizationHandler pHandler) Returns the available connections of this pool for a given URIinvalid input: '&AuthorizationHandler'boolean
returnAvailableConnectionToPool
(HttpClient httpClient) Add the connection to the pool.
-
Constructor Details
-
HttpClientPool
Ctor.- Parameters:
pConfiguration
- The configuration for this session. Must be non-null.
-
-
Method Details
-
getNumberOfAllConnections
public int getNumberOfAllConnections()Returns the number of connections in this pool that are available/free for (re-)use.- Returns:
- number of available/free connections in pool
-
getNumberOfAvailableConnections
public int getNumberOfAvailableConnections()Returns the number of all connections in this pool.- Returns:
- number of all connections in pool
-
getConfigurationContext
Returns the configuration context of this pool- Returns:
- The configuration
-
getSslContext
Returns the SSL context for the clients in this pool. The context is initialized on the first call of this method (lazy initialization).- Returns:
- The SSL context
-
retrieveAvailableConnectionFromPool
Returns the available connections of this pool for a given URIinvalid input: '&AuthorizationHandler'- Parameters:
pUri
- The uripHandler
- The authorization handler- Returns:
- A connection if one is available,
null
otherwise
-
returnAvailableConnectionToPool
Add the connection to the pool. Connection is added as available connection. Use methodaddConnectionToPool(HttpClient)
to add the connection without being available for reuse.- Parameters:
httpClient
- connection that is to be added to the pool- Returns:
- true if connection was added otherwise false
-
addConnectionToPool
Add the connection to the pool, but does NOT add it as available connection. Use methodreturnAvailableConnectionToPool(HttpClient)
to also add the connection to the available connections.- Parameters:
httpClient
- connection that is to be added to the pool- Returns:
- true if connection was added otherwise false
-
removeConnectionFromPool
Removes a connection completely from the pool.- Parameters:
httpClient
- connection that is to be removed from the pool- Returns:
- true if connection was removed otherwise false
-
closePool
public void closePool()Closes the pool. This will disconnect all clients in the pool. -
finalize
-
getPoolSize
public int getPoolSize()Returns poolSize- Returns:
- The value of poolSize.
-
getUpdatedCipherSuites
Returns updated array of cipher suites which is current cipher suites less any cipher suites listed to be disabled NOTE: The updated array is generated only upon first invocation and then saved, effectively making this a lazy initialization of the cipher suites on a HttpClientPool basis - it has to be done here and not in WBEMClient where it belongs because socket characteristics are not known to WBEMClient- Parameters:
pCurrentCipherSuites
- The currently enabled cipher suitespDisableCipherSuites
- The list of cipher suites to be disabled- Returns:
- The updated enabled cipher suites
-