Package org.apache.http.conn.params
Class ConnRouteParams
java.lang.Object
org.apache.http.conn.params.ConnRouteParams
- All Implemented Interfaces:
ConnRoutePNames
public class ConnRouteParams extends Object implements ConnRoutePNames
An adaptor for accessing route related parameters in
HttpParams.
See ConnRoutePNames for parameter name definitions.- Since:
- 4.0
- Version:
- $Revision: 658785 $
- Author:
- Oleg Kalnichevski, Roland Weber
-
Field Summary
Fields Modifier and Type Field Description static HttpHostNO_HOSTA special value indicating "no host".static HttpRouteNO_ROUTEA special value indicating "no route".Fields inherited from interface org.apache.http.conn.params.ConnRoutePNames
DEFAULT_PROXY, FORCED_ROUTE, LOCAL_ADDRESS -
Method Summary
Modifier and Type Method Description static HttpHostgetDefaultProxy(HttpParams params)Obtains theDEFAULT_PROXYparameter value.static HttpRoutegetForcedRoute(HttpParams params)Obtains theFORCED_ROUTEparameter value.static InetAddressgetLocalAddress(HttpParams params)Obtains theLOCAL_ADDRESSparameter value.static voidsetDefaultProxy(HttpParams params, HttpHost proxy)Sets theDEFAULT_PROXYparameter value.static voidsetForcedRoute(HttpParams params, HttpRoute route)Sets theFORCED_ROUTEparameter value.static voidsetLocalAddress(HttpParams params, InetAddress local)Sets theLOCAL_ADDRESSparameter value.
-
Field Details
-
NO_HOST
A special value indicating "no host". This relies on a nonsense scheme name to avoid conflicts with actual hosts. Note that this is a valid host. -
NO_ROUTE
A special value indicating "no route". This is a route withNO_HOSTas the target.
-
-
Method Details
-
getDefaultProxy
Obtains theDEFAULT_PROXYparameter value.NO_HOSTwill be mapped tonull, to allow unsetting in a hierarchy.- Parameters:
params- the parameters in which to look up- Returns:
- the default proxy set in the argument parameters, or
nullif not set
-
setDefaultProxy
Sets theDEFAULT_PROXYparameter value.- Parameters:
params- the parameters in which to set the valueproxy- the value to set, may benull. Note thatNO_HOSTwill be mapped tonullbygetDefaultProxy(org.apache.http.params.HttpParams), to allow for explicit unsetting in hierarchies.
-
getForcedRoute
Obtains theFORCED_ROUTEparameter value.NO_ROUTEwill be mapped tonull, to allow unsetting in a hierarchy.- Parameters:
params- the parameters in which to look up- Returns:
- the forced route set in the argument parameters, or
nullif not set
-
setForcedRoute
Sets theFORCED_ROUTEparameter value.- Parameters:
params- the parameters in which to set the valueroute- the value to set, may benull. Note thatNO_ROUTEwill be mapped tonullbygetForcedRoute(org.apache.http.params.HttpParams), to allow for explicit unsetting in hierarchies.
-
getLocalAddress
Obtains theLOCAL_ADDRESSparameter value. There is no special value that would automatically be mapped tonull. You can use the wildcard address (0.0.0.0 for IPv4, :: for IPv6) to override a specific local address in a hierarchy.- Parameters:
params- the parameters in which to look up- Returns:
- the local address set in the argument parameters, or
nullif not set
-
setLocalAddress
Sets theLOCAL_ADDRESSparameter value.- Parameters:
params- the parameters in which to set the valuelocal- the value to set, may benull
-