|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.conn.RouteTracker
public final class RouteTracker
Helps tracking the steps in establishing a route.
Constructor Summary | |
---|---|
RouteTracker(org.apache.http.HttpHost target,
java.net.InetAddress local)
Creates a new route tracker. |
|
RouteTracker(HttpRoute route)
Creates a new tracker for the given route. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
void |
connectProxy(org.apache.http.HttpHost proxy,
boolean secure)
Tracks connecting to the first proxy. |
void |
connectTarget(boolean secure)
Tracks connecting to the target. |
boolean |
equals(java.lang.Object o)
Compares this tracked route to another. |
int |
getHopCount()
Obtains the number of tracked hops. |
org.apache.http.HttpHost |
getHopTarget(int hop)
Obtains the target of a hop in this route. |
java.net.InetAddress |
getLocalAddress()
Obtains the local address to connect from. |
org.apache.http.HttpHost |
getProxyHost()
Obtains the first proxy host. |
org.apache.http.HttpHost |
getTargetHost()
Obtains the target host. |
int |
hashCode()
Generates a hash code for this tracked route. |
boolean |
isConnected()
Checks whether this route is connected to it's first hop. |
boolean |
isLayered()
Checks whether this route includes a layered protocol. |
boolean |
isSecure()
Checks whether this route is secure. |
boolean |
isTunnelled()
Checks whether this route is tunnelled through a proxy. |
void |
layerProtocol(boolean secure)
Tracks layering a protocol. |
HostConfiguration |
toHostConfig()
Deprecated. use toRoute instead. Kept temporarily
until HttpRoute takes over from HostConfiguration . |
HttpRoute |
toRoute()
Obtains the tracked route. |
java.lang.String |
toString()
Obtains a description of the tracked route. |
void |
tunnelProxy(org.apache.http.HttpHost proxy,
boolean secure)
Tracks tunnelling to a proxy in a proxy chain. |
void |
tunnelTarget(boolean secure)
Tracks tunnelling to the target. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RouteTracker(org.apache.http.HttpHost target, java.net.InetAddress local)
target
- the host to which to routelocal
- the local address to route from, or
null
for the defaultpublic RouteTracker(HttpRoute route)
route
- the route to trackMethod Detail |
---|
public final void connectTarget(boolean secure)
secure
- true
if the route is secure,
false
otherwisepublic final void connectProxy(org.apache.http.HttpHost proxy, boolean secure)
proxy
- the proxy connected tosecure
- true
if the route is secure,
false
otherwisepublic final void tunnelTarget(boolean secure)
secure
- true
if the route is secure,
false
otherwisepublic final void tunnelProxy(org.apache.http.HttpHost proxy, boolean secure)
proxy
- the proxy tunnelled tosecure
- true
if the route is secure,
false
otherwisepublic final void layerProtocol(boolean secure)
secure
- true
if the route is secure,
false
otherwisepublic final org.apache.http.HttpHost getTargetHost()
public final java.net.InetAddress getLocalAddress()
null
public final int getHopCount()
public final org.apache.http.HttpHost getHopTarget(int hop)
hop
- index of the hop for which to get the target,
0 for first
java.lang.IllegalArgumentException
- if the argument is negative or not less than
getHopCount()
public final org.apache.http.HttpHost getProxyHost()
null
if not trackedpublic final boolean isConnected()
true
if connected,
false
otherwisepublic final boolean isTunnelled()
true
if tunnelled,
false
otherwisepublic final boolean isLayered()
true
if layered,
false
otherwisepublic final boolean isSecure()
true
if secure,
false
otherwisepublic final HttpRoute toRoute()
connected
.
If not connected, nothing has been tracked so far.
null
if nothing has been tracked so farpublic final HostConfiguration toHostConfig()
toRoute
instead. Kept temporarily
until HttpRoute
takes over from HostConfiguration
.
HostConfiguration
is used to
represent the route. It does not cover all tracked attributes.
In particular, it can not represent intermediate steps in establishing
a route.
public final boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object to compare with
true
if the argument is the same tracked route,
false
public final int hashCode()
toRoute
to obtain an
unmodifiable representation of the tracked route.
hashCode
in class java.lang.Object
public final java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |