Package org.apache.http.conn.routing
Class BasicRouteDirector
java.lang.Object
org.apache.http.conn.routing.BasicRouteDirector
- All Implemented Interfaces:
HttpRouteDirector
public class BasicRouteDirector extends Object implements HttpRouteDirector
Basic implementation of an
HttpRouteDirector.
This implementation is stateless and therefore thread-safe.- Since:
- 4.0
- Version:
- $Revision: 620255 $
- Author:
- Roland Weber
-
Field Summary
Fields inherited from interface org.apache.http.conn.routing.HttpRouteDirector
COMPLETE, CONNECT_PROXY, CONNECT_TARGET, LAYER_PROTOCOL, TUNNEL_PROXY, TUNNEL_TARGET, UNREACHABLE -
Constructor Summary
Constructors Constructor Description BasicRouteDirector() -
Method Summary
Modifier and Type Method Description protected intdirectStep(RouteInfo plan, RouteInfo fact)Determines the next step to establish a direct connection.protected intfirstStep(RouteInfo plan)Determines the first step to establish a route.intnextStep(RouteInfo plan, RouteInfo fact)Provides the next step.protected intproxiedStep(RouteInfo plan, RouteInfo fact)Determines the next step to establish a connection via proxy.
-
Constructor Details
-
BasicRouteDirector
public BasicRouteDirector()
-
-
Method Details
-
nextStep
Provides the next step.- Specified by:
nextStepin interfaceHttpRouteDirector- Parameters:
plan- the planned routefact- the currently established route, ornullif nothing is established- Returns:
- one of the constants defined in this class, indicating either the next step to perform, or success, or failure. 0 is for success, a negative value for failure.
-
firstStep
Determines the first step to establish a route.- Parameters:
plan- the planned route- Returns:
- the first step
-
directStep
Determines the next step to establish a direct connection.- Parameters:
plan- the planned routefact- the currently established route- Returns:
- one of the constants defined in this class, indicating either the next step to perform, or success, or failure
-
proxiedStep
Determines the next step to establish a connection via proxy.- Parameters:
plan- the planned routefact- the currently established route- Returns:
- one of the constants defined in this class, indicating either the next step to perform, or success, or failure
-