org.apache.commons.httpclient.params

Class HttpConnectionManagerParams

public class HttpConnectionManagerParams extends HttpConnectionParams

This class represents a collection of HTTP protocol parameters applicable to {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection managers}. Protocol parameters may be linked together to form a hierarchy. If a particular parameter value has not been explicitly defined in the collection itself, its value will be drawn from the parent collection of parameters.

Since: 3.0

Version: $Revision: 354155 $

Author: Oleg Kalnichevski Michael Becke

Field Summary
static StringMAX_HOST_CONNECTIONS
Defines the maximum number of connections allowed per host configuration.
static StringMAX_TOTAL_CONNECTIONS
Defines the maximum number of connections allowed overall.
Method Summary
intgetDefaultMaxConnectionsPerHost()
Gets the default maximum number of connections allowed for a given host config.
intgetMaxConnectionsPerHost(HostConfiguration hostConfiguration)
Gets the maximum number of connections to be used for a particular host config.
intgetMaxTotalConnections()
Gets the maximum number of connections allowed.
voidsetDefaultMaxConnectionsPerHost(int maxHostConnections)
Sets the default maximum number of connections allowed for a given host config.
voidsetMaxConnectionsPerHost(HostConfiguration hostConfiguration, int maxHostConnections)
Sets the maximum number of connections to be used for the given host config.
voidsetMaxTotalConnections(int maxTotalConnections)
Sets the maximum number of connections allowed.

Field Detail

MAX_HOST_CONNECTIONS

public static final String MAX_HOST_CONNECTIONS
Defines the maximum number of connections allowed per host configuration. These values only apply to the number of connections from a particular instance of HttpConnectionManager.

This parameter expects a value of type {@link java.util.Map}. The value should map instances of {@link org.apache.commons.httpclient.HostConfiguration} to {@link Integer integers}. The default value can be specified using {@link org.apache.commons.httpclient.HostConfiguration#ANY_HOST_CONFIGURATION}.

MAX_TOTAL_CONNECTIONS

public static final String MAX_TOTAL_CONNECTIONS
Defines the maximum number of connections allowed overall. This value only applies to the number of connections from a particular instance of HttpConnectionManager.

This parameter expects a value of type {@link Integer}.

Method Detail

getDefaultMaxConnectionsPerHost

public int getDefaultMaxConnectionsPerHost()
Gets the default maximum number of connections allowed for a given host config.

Returns: The default maximum.

See Also: MAX_HOST_CONNECTIONS

getMaxConnectionsPerHost

public int getMaxConnectionsPerHost(HostConfiguration hostConfiguration)
Gets the maximum number of connections to be used for a particular host config. If the value has not been specified for the given host the default value will be returned.

Parameters: hostConfiguration The host config.

Returns: The maximum number of connections to be used for the given host config.

See Also: MAX_HOST_CONNECTIONS

getMaxTotalConnections

public int getMaxTotalConnections()
Gets the maximum number of connections allowed.

Returns: The maximum number of connections allowed.

See Also: MAX_TOTAL_CONNECTIONS

setDefaultMaxConnectionsPerHost

public void setDefaultMaxConnectionsPerHost(int maxHostConnections)
Sets the default maximum number of connections allowed for a given host config.

Parameters: maxHostConnections The default maximum.

See Also: MAX_HOST_CONNECTIONS

setMaxConnectionsPerHost

public void setMaxConnectionsPerHost(HostConfiguration hostConfiguration, int maxHostConnections)
Sets the maximum number of connections to be used for the given host config.

Parameters: hostConfiguration The host config to set the maximum for. Use {@link HostConfiguration#ANY_HOST_CONFIGURATION} to configure the default value per host. maxHostConnections The maximum number of connections, > 0

See Also: MAX_HOST_CONNECTIONS

setMaxTotalConnections

public void setMaxTotalConnections(int maxTotalConnections)
Sets the maximum number of connections allowed.

Parameters: maxTotalConnections The maximum number of connections allowed.

See Also: MAX_TOTAL_CONNECTIONS

Copyright (c) 1999-2005 - Apache Software Foundation