@NotThreadSafe public final class RouteTracker extends java.lang.Object implements RouteInfo, java.lang.Cloneable
RouteInfo.LayerType, RouteInfo.TunnelType| 构造器和说明 |
|---|
RouteTracker(HttpHost target,
java.net.InetAddress local)
Creates a new route tracker.
|
RouteTracker(HttpRoute route)
Creates a new tracker for the given route.
|
| 限定符和类型 | 方法和说明 |
|---|---|
java.lang.Object |
clone() |
void |
connectProxy(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 hops in this route.
|
HttpHost |
getHopTarget(int hop)
Obtains the target of a hop in this route.
|
RouteInfo.LayerType |
getLayerType()
Obtains the layering category of this route.
|
java.net.InetAddress |
getLocalAddress()
Obtains the local address to connect from.
|
HttpHost |
getProxyHost()
Obtains the first proxy host.
|
HttpHost |
getTargetHost()
Obtains the target host.
|
RouteInfo.TunnelType |
getTunnelType()
Obtains the tunnel category of this route.
|
int |
hashCode()
Generates a hash code for this tracked route.
|
boolean |
isConnected() |
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.
|
void |
reset() |
HttpRoute |
toRoute()
Obtains the tracked route.
|
java.lang.String |
toString()
Obtains a description of the tracked route.
|
void |
tunnelProxy(HttpHost proxy,
boolean secure)
Tracks tunnelling to a proxy in a proxy chain.
|
void |
tunnelTarget(boolean secure)
Tracks tunnelling to the target.
|
public RouteTracker(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 trackpublic void reset()
public final void connectTarget(boolean secure)
secure - true if the route is secure,
false otherwisepublic final void connectProxy(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(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 HttpHost getTargetHost()
RouteInfogetTargetHost 在接口中 RouteInfopublic final java.net.InetAddress getLocalAddress()
RouteInfogetLocalAddress 在接口中 RouteInfonullpublic final int getHopCount()
RouteInfogetHopCount 在接口中 RouteInfopublic final HttpHost getHopTarget(int hop)
RouteInfotarget host,
the target of previous hops is the respective proxy in the chain.
For a route through exactly one proxy, target of hop 0 is the proxy
and target of hop 1 is the target host.getHopTarget 在接口中 RouteInfohop - index of the hop for which to get the target,
0 for firstpublic final HttpHost getProxyHost()
RouteInfogetProxyHost 在接口中 RouteInfonull if this route is directpublic final boolean isConnected()
public final RouteInfo.TunnelType getTunnelType()
RouteInfogetTunnelType 在接口中 RouteInfopublic final boolean isTunnelled()
RouteInfoisTunnelled 在接口中 RouteInfotrue if tunnelled end-to-end through at least
one proxy,
false otherwisepublic final RouteInfo.LayerType getLayerType()
RouteInfogetLayerType 在接口中 RouteInfopublic final boolean isLayered()
RouteInfopublic final boolean isSecure()
RouteInfopublic final HttpRoute toRoute()
connected.
If not connected, nothing has been tracked so far.null if nothing has been tracked so farpublic final boolean equals(java.lang.Object o)
equals 在类中 java.lang.Objecto - the object to compare withtrue if the argument is the same tracked route,
falsepublic final int hashCode()
toRoute to obtain an
unmodifiable representation of the tracked route.hashCode 在类中 java.lang.Objectpublic final java.lang.String toString()
toString 在类中 java.lang.Objectpublic java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone 在类中 java.lang.Objectjava.lang.CloneNotSupportedException