org.apache.commons.httpclient.params

Class HttpClientParams

public class HttpClientParams extends HttpMethodParams

This class represents a collection of HTTP protocol parameters applicable to {@link org.apache.commons.httpclient.HttpClient instances of HttpClient}. 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

Field Summary
static StringALLOW_CIRCULAR_REDIRECTS
Defines whether circular redirects (redirects to the same location) should be allowed.
static StringCONNECTION_MANAGER_CLASS
Defines the default {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager} class.
static StringCONNECTION_MANAGER_TIMEOUT
Sets the timeout in milliseconds used when retrieving an {@link org.apache.commons.httpclient.HttpConnection HTTP connection} from the {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager}.
static StringMAX_REDIRECTS
Defines the maximum number of redirects to be followed.
static StringPREEMPTIVE_AUTHENTICATION
Defines whether authentication should be attempted preemptively.
static StringREJECT_RELATIVE_REDIRECT
Defines whether relative redirects should be rejected.
Constructor Summary
HttpClientParams()
Creates a new collection of parameters with the collection returned by {@link #getDefaultParams()} as a parent.
HttpClientParams(HttpParams defaults)
Creates a new collection of parameters with the given parent.
Method Summary
ClassgetConnectionManagerClass()
Returns the default {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager} class.
longgetConnectionManagerTimeout()
Returns the timeout in milliseconds used when retrieving an {@link org.apache.commons.httpclient.HttpConnection HTTP connection} from the {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager}.
booleanisAuthenticationPreemptive()
Returns true if authentication should be attempted preemptively, false otherwise.
voidmakeLenient()
voidmakeStrict()
voidsetAuthenticationPreemptive(boolean value)
Sets whether authentication should be attempted preemptively.
voidsetConnectionManagerClass(Class clazz)
Sets {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager} class to be used der default.
voidsetConnectionManagerTimeout(long timeout)
Sets the timeout in milliseconds used when retrieving an {@link org.apache.commons.httpclient.HttpConnection HTTP connection} from the {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager}.

Field Detail

ALLOW_CIRCULAR_REDIRECTS

public static final String ALLOW_CIRCULAR_REDIRECTS
Defines whether circular redirects (redirects to the same location) should be allowed. The HTTP spec is not sufficiently clear whether circular redirects are permitted, therefore optionally they can be enabled

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

CONNECTION_MANAGER_CLASS

public static final String CONNECTION_MANAGER_CLASS
Defines the default {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager} class.

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

CONNECTION_MANAGER_TIMEOUT

public static final String CONNECTION_MANAGER_TIMEOUT
Sets the timeout in milliseconds used when retrieving an {@link org.apache.commons.httpclient.HttpConnection HTTP connection} from the {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager}.

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

MAX_REDIRECTS

public static final String MAX_REDIRECTS
Defines the maximum number of redirects to be followed. The limit on number of redirects is intended to prevent infinite loops.

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

PREEMPTIVE_AUTHENTICATION

public static final String PREEMPTIVE_AUTHENTICATION
Defines whether authentication should be attempted preemptively.

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

REJECT_RELATIVE_REDIRECT

public static final String REJECT_RELATIVE_REDIRECT
Defines whether relative redirects should be rejected.

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

Constructor Detail

HttpClientParams

public HttpClientParams()
Creates a new collection of parameters with the collection returned by {@link #getDefaultParams()} as a parent. The collection will defer to its parent for a default value if a particular parameter is not explicitly set in the collection itself.

See Also: HttpClientParams

HttpClientParams

public HttpClientParams(HttpParams defaults)
Creates a new collection of parameters with the given parent. The collection will defer to its parent for a default value if a particular parameter is not explicitly set in the collection itself.

Parameters: defaults the parent collection to defer to, if a parameter is not explictly set in the collection itself.

See Also: HttpClientParams

Method Detail

getConnectionManagerClass

public Class getConnectionManagerClass()
Returns the default {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager} class.

Returns: {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager} factory class.

getConnectionManagerTimeout

public long getConnectionManagerTimeout()
Returns the timeout in milliseconds used when retrieving an {@link org.apache.commons.httpclient.HttpConnection HTTP connection} from the {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager}.

Returns: timeout in milliseconds.

isAuthenticationPreemptive

public boolean isAuthenticationPreemptive()
Returns true if authentication should be attempted preemptively, false otherwise.

Returns: true if authentication should be attempted preemptively, false otherwise.

makeLenient

public void makeLenient()

makeStrict

public void makeStrict()

setAuthenticationPreemptive

public void setAuthenticationPreemptive(boolean value)
Sets whether authentication should be attempted preemptively.

Parameters: value true if authentication should be attempted preemptively, false otherwise.

setConnectionManagerClass

public void setConnectionManagerClass(Class clazz)
Sets {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager} class to be used der default.

Parameters: clazz {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager} factory class.

setConnectionManagerTimeout

public void setConnectionManagerTimeout(long timeout)
Sets the timeout in milliseconds used when retrieving an {@link org.apache.commons.httpclient.HttpConnection HTTP connection} from the {@link org.apache.commons.httpclient.HttpConnectionManager HTTP connection manager}.

Parameters: timeout the timeout in milliseconds

Copyright (c) 1999-2005 - Apache Software Foundation