Package org.apache.commons.httpclient
Class SimpleHttpConnectionManager
- java.lang.Object
-
- org.apache.commons.httpclient.SimpleHttpConnectionManager
-
- All Implemented Interfaces:
HttpConnectionManager
@Deprecated public class SimpleHttpConnectionManager extends java.lang.Object implements HttpConnectionManager
Deprecated.Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project. It is not recommended to use it in any new code. Instead, use HTTP client API plugins as a dependency in your code. E.g. Apache HttpComponents Client API 4.x Plugin or Async HTTP Client Plugin.A connection manager that provides access to a single HttpConnection. This manager makes no attempt to provide exclusive access to the contained HttpConnection.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description SimpleHttpConnectionManager()
Deprecated.The connection manager created with this constructor will always try to keep the connection open (alive) between consecutive requests.SimpleHttpConnectionManager(boolean alwaysClose)
Deprecated.The connection manager created with this constructor will try to keep the connection open (alive) between consecutive requests if the alwaysClose parameter is set to false.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
closeIdleConnections(long idleTimeout)
Deprecated.Closes connections that have been idle for at least the given amount of time.HttpConnection
getConnection(HostConfiguration hostConfiguration)
Deprecated.Gets an HttpConnection for a given host configuration.HttpConnection
getConnection(HostConfiguration hostConfiguration, long timeout)
Deprecated.Use #getConnectionWithTimeout(HostConfiguration, long)HttpConnection
getConnectionWithTimeout(HostConfiguration hostConfiguration, long timeout)
Deprecated.This method always returns the same connection object.HttpConnectionManagerParams
getParams()
Deprecated.Returnsparameters
associated with this connection manager.boolean
isConnectionStaleCheckingEnabled()
void
releaseConnection(HttpConnection conn)
Deprecated.Releases the given HttpConnection for use by other requests.void
setConnectionStaleCheckingEnabled(boolean connectionStaleCheckingEnabled)
void
setParams(HttpConnectionManagerParams params)
Deprecated.Assignsparameters
for this connection manager.void
shutdown()
Deprecated.since 3.1
-
-
-
Constructor Detail
-
SimpleHttpConnectionManager
public SimpleHttpConnectionManager(boolean alwaysClose)
Deprecated.The connection manager created with this constructor will try to keep the connection open (alive) between consecutive requests if the alwaysClose parameter is set to false. Otherwise the connection manager will always close connections upon release.- Parameters:
alwaysClose
- if set true, the connection manager will always close connections upon release.
-
SimpleHttpConnectionManager
public SimpleHttpConnectionManager()
Deprecated.The connection manager created with this constructor will always try to keep the connection open (alive) between consecutive requests.
-
-
Method Detail
-
getConnection
public HttpConnection getConnection(HostConfiguration hostConfiguration)
Deprecated.Description copied from interface:HttpConnectionManager
Gets an HttpConnection for a given host configuration. If a connection is not available this method will block until one is. The connection manager should be registered with any HttpConnection that is created.- Specified by:
getConnection
in interfaceHttpConnectionManager
- Parameters:
hostConfiguration
- the host configuration to use to configure the connection- Returns:
- an HttpConnection for the given configuration
- See Also:
HttpConnectionManager.getConnection(HostConfiguration)
-
isConnectionStaleCheckingEnabled
public boolean isConnectionStaleCheckingEnabled()
Gets the staleCheckingEnabled value to be set on HttpConnections that are created.- Returns:
true
if stale checking will be enabled on HttpConections- See Also:
HttpConnection.isStaleCheckingEnabled()
-
setConnectionStaleCheckingEnabled
public void setConnectionStaleCheckingEnabled(boolean connectionStaleCheckingEnabled)
Deprecated.Sets the staleCheckingEnabled value to be set on HttpConnections that are created.- Parameters:
connectionStaleCheckingEnabled
-true
if stale checking will be enabled on HttpConections- See Also:
HttpConnection.setStaleCheckingEnabled(boolean)
-
getConnectionWithTimeout
public HttpConnection getConnectionWithTimeout(HostConfiguration hostConfiguration, long timeout)
Deprecated.This method always returns the same connection object. If the connection is already open, it will be closed and the new host configuration will be applied.- Specified by:
getConnectionWithTimeout
in interfaceHttpConnectionManager
- Parameters:
hostConfiguration
- The host configuration specifying the connection details.timeout
- this parameter has no effect. The connection is always returned immediately.- Returns:
- an HttpConnection for the given configuraiton
- Since:
- 3.0
- See Also:
HttpConnection.setHttpConnectionManager(HttpConnectionManager)
-
getConnection
public HttpConnection getConnection(HostConfiguration hostConfiguration, long timeout)
Deprecated.Use #getConnectionWithTimeout(HostConfiguration, long)Description copied from interface:HttpConnectionManager
Gets an HttpConnection for a given host configuration. If a connection is not available, this method will block for at most the specified number of milliseconds or until a connection becomes available. The connection manager should be registered with any HttpConnection that is created.- Specified by:
getConnection
in interfaceHttpConnectionManager
- Parameters:
hostConfiguration
- the host configuration to use to configure the connectiontimeout
- - the time (in milliseconds) to wait for a connection to become available, 0 to specify an infinite timeout- Returns:
- an HttpConnection for the given configuraiton
- See Also:
HttpConnectionManager.getConnection(HostConfiguration, long)
-
releaseConnection
public void releaseConnection(HttpConnection conn)
Deprecated.Description copied from interface:HttpConnectionManager
Releases the given HttpConnection for use by other requests.- Specified by:
releaseConnection
in interfaceHttpConnectionManager
- Parameters:
conn
- - The HttpConnection to make available.- See Also:
HttpConnectionManager.releaseConnection(org.apache.commons.httpclient.HttpConnection)
-
getParams
public HttpConnectionManagerParams getParams()
Deprecated.Returnsparameters
associated with this connection manager.- Specified by:
getParams
in interfaceHttpConnectionManager
- Since:
- 2.1
- See Also:
HttpConnectionManagerParams
-
setParams
public void setParams(HttpConnectionManagerParams params)
Deprecated.Assignsparameters
for this connection manager.- Specified by:
setParams
in interfaceHttpConnectionManager
- Since:
- 2.1
- See Also:
HttpConnectionManagerParams
-
closeIdleConnections
public void closeIdleConnections(long idleTimeout)
Deprecated.Description copied from interface:HttpConnectionManager
Closes connections that have been idle for at least the given amount of time. Only connections that are currently owned, not checked out, are subject to idle timeouts.- Specified by:
closeIdleConnections
in interfaceHttpConnectionManager
- Parameters:
idleTimeout
- the minimum idle time, in milliseconds, for connections to be closed- Since:
- 3.0
-
shutdown
public void shutdown()
Deprecated.since 3.1
-
-