org.apache.http.conn.params
Class HttpConnectionManagerParams

java.lang.Object
  extended by org.apache.http.conn.params.HttpConnectionManagerParams

public final class HttpConnectionManagerParams
extends java.lang.Object

This class represents a collection of HTTP protocol parameters applicable to client-side connection managers.

Since:
4.0
Version:
$Revision: 541918 $
Author:
Oleg Kalnichevski, Michael Becke

Field Summary
static int DEFAULT_MAX_HOST_CONNECTIONS
          The default maximum number of connections allowed per host
static int DEFAULT_MAX_TOTAL_CONNECTIONS
          The default maximum number of connections allowed overall
static java.lang.String MAX_HOST_CONNECTIONS
          Defines the maximum number of connections allowed per host configuration.
static java.lang.String MAX_TOTAL_CONNECTIONS
          Defines the maximum number of connections allowed overall.
 
Constructor Summary
HttpConnectionManagerParams()
           
 
Method Summary
static int getDefaultMaxConnectionsPerHost(org.apache.http.params.HttpParams params)
          Gets the default maximum number of connections allowed for a given host config.
static int getMaxConnectionsPerHost(org.apache.http.params.HttpParams params, HostConfiguration hostConfiguration)
          Gets the maximum number of connections to be used for a particular host config.
static int getMaxTotalConnections(org.apache.http.params.HttpParams params)
          Gets the maximum number of connections allowed.
static void setDefaultMaxConnectionsPerHost(org.apache.http.params.HttpParams params, int maxHostConnections)
          Sets the default maximum number of connections allowed for a given host config.
static void setMaxConnectionsPerHost(org.apache.http.params.HttpParams params, HostConfiguration hostConfiguration, int maxHostConnections)
          Sets the maximum number of connections to be used for the given host config.
static void setMaxTotalConnections(org.apache.http.params.HttpParams params, int maxTotalConnections)
          Sets the maximum number of connections allowed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_HOST_CONNECTIONS

public static final int DEFAULT_MAX_HOST_CONNECTIONS
The default maximum number of connections allowed per host

See Also:
Constant Field Values

DEFAULT_MAX_TOTAL_CONNECTIONS

public static final int DEFAULT_MAX_TOTAL_CONNECTIONS
The default maximum number of connections allowed overall

See Also:
Constant Field Values

MAX_HOST_CONNECTIONS

public static final java.lang.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 Map. The value should map instances of HostConfiguration to integers. The default value can be specified using HostConfiguration.ANY_HOST_CONFIGURATION.

See Also:
Constant Field Values

MAX_TOTAL_CONNECTIONS

public static final java.lang.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 Integer.

See Also:
Constant Field Values
Constructor Detail

HttpConnectionManagerParams

public HttpConnectionManagerParams()
Method Detail

setDefaultMaxConnectionsPerHost

public static void setDefaultMaxConnectionsPerHost(org.apache.http.params.HttpParams params,
                                                   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 static void setMaxConnectionsPerHost(org.apache.http.params.HttpParams params,
                                            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 HostConfiguration.ANY_HOST_CONFIGURATION to configure the default value per host.
maxHostConnections - The maximum number of connections, > 0
See Also:
MAX_HOST_CONNECTIONS

getDefaultMaxConnectionsPerHost

public static int getDefaultMaxConnectionsPerHost(org.apache.http.params.HttpParams params)
Gets the default maximum number of connections allowed for a given host config.

Returns:
The default maximum.
See Also:
MAX_HOST_CONNECTIONS

getMaxConnectionsPerHost

public static int getMaxConnectionsPerHost(org.apache.http.params.HttpParams params,
                                           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

setMaxTotalConnections

public static void setMaxTotalConnections(org.apache.http.params.HttpParams params,
                                          int maxTotalConnections)
Sets the maximum number of connections allowed.

Parameters:
maxTotalConnections - The maximum number of connections allowed.
See Also:
MAX_TOTAL_CONNECTIONS

getMaxTotalConnections

public static int getMaxTotalConnections(org.apache.http.params.HttpParams params)
Gets the maximum number of connections allowed.

Returns:
The maximum number of connections allowed.
See Also:
MAX_TOTAL_CONNECTIONS


Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.