org.apache.http.conn
Class RouteDirector

java.lang.Object
  extended by org.apache.http.conn.RouteDirector

public class RouteDirector
extends java.lang.Object

Provides directions on establishing a route. Instances of this class compare a planned route with a tracked route and indicate the next step required.

Since:
4.0
Version:
$Revision: 550077 $
Author:
Roland Weber

Field Summary
static int COMPLETE
          Indicates that the route is complete.
static int CONNECT_PROXY
          Step: open connection to proxy.
static int CONNECT_TARGET
          Step: open connection to target.
static int LAYER_PROTOCOL
          Step: layer protocol (over tunnel).
static int TUNNEL_PROXY
          Step: tunnel through proxy to other proxy.
static int TUNNEL_TARGET
          Step: tunnel through proxy to target.
static int UNREACHABLE
          Indicates that the route can not be established at all.
 
Constructor Summary
RouteDirector()
           
 
Method Summary
protected  int directStep(HttpRoute plan, HttpRoute fact)
          Determines the next step to establish a direct connection.
protected  int firstStep(HttpRoute plan)
          Determines the first step to establish a route.
 int nextStep(HttpRoute plan, HttpRoute fact)
          Provides the next step.
protected  int proxiedStep(HttpRoute plan, HttpRoute fact)
          Determines the next step to establish a connection via proxy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNREACHABLE

public static final int UNREACHABLE
Indicates that the route can not be established at all.

See Also:
Constant Field Values

COMPLETE

public static final int COMPLETE
Indicates that the route is complete.

See Also:
Constant Field Values

CONNECT_TARGET

public static final int CONNECT_TARGET
Step: open connection to target.

See Also:
Constant Field Values

CONNECT_PROXY

public static final int CONNECT_PROXY
Step: open connection to proxy.

See Also:
Constant Field Values

TUNNEL_TARGET

public static final int TUNNEL_TARGET
Step: tunnel through proxy to target.

See Also:
Constant Field Values

TUNNEL_PROXY

public static final int TUNNEL_PROXY
Step: tunnel through proxy to other proxy.

See Also:
Constant Field Values

LAYER_PROTOCOL

public static final int LAYER_PROTOCOL
Step: layer protocol (over tunnel).

See Also:
Constant Field Values
Constructor Detail

RouteDirector

public RouteDirector()
Method Detail

nextStep

public int nextStep(HttpRoute plan,
                    HttpRoute fact)
Provides the next step.

Parameters:
plan - the planned route
fact - the currently established route, or null if 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

protected int firstStep(HttpRoute plan)
Determines the first step to establish a route.

Parameters:
plan - the planned route
Returns:
the first step

directStep

protected int directStep(HttpRoute plan,
                         HttpRoute fact)
Determines the next step to establish a direct connection.

Parameters:
plan - the planned route
fact - 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

protected int proxiedStep(HttpRoute plan,
                          HttpRoute fact)
Determines the next step to establish a connection via proxy.

Parameters:
plan - the planned route
fact - the currently established route
Returns:
one of the constants defined in this class, indicating either the next step to perform, or success, or failure


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