org.apache.http.conn.routing.RouteInfo
org.apache.http.conn.routing.RouteInfo |
|
Read-only interface for route information.
Nested Classes
Known Indirect Subclasses
Summary
Details
Public Methods
public
int
getHopCount()
Obtains the number of hops in this route.
A direct route has one hop. A route through a proxy has two hops.
A route through a chain of
n proxies has
n+1 hops.
Returns
- the number of hops in this route
public
HttpHost
getHopTarget(int hop)
Obtains the target of a hop in this route.
The target of the last hop is the
target 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.
Parameters
hop
| index of the hop for which to get the target,
0 for first |
Returns
- the target of the given hop
Obtains the layering type of this route.
In the presence of proxies, only layering over an end-to-end tunnel
is considered.
public
InetAddress
getLocalAddress()
Obtains the local address to connect from.
Returns
- the local address,
or
null
public
HttpHost
getProxyHost()
Obtains the first proxy host.
Returns
- the first proxy in the proxy chain, or
null
if this route is direct
Obtains the tunnel type of this route.
If there is a proxy chain, only end-to-end tunnels are considered.
public
boolean
isLayered()
Checks whether this route includes a layered protocol.
In the presence of proxies, only layering over an end-to-end tunnel
is considered.
Returns
true
if layered,
false
otherwise
public
boolean
isSecure()
Checks whether this route is secure.
Returns
true
if secure,
false
otherwise
public
boolean
isTunnelled()
Checks whether this route is tunnelled through a proxy.
If there is a proxy chain, only end-to-end tunnels are considered.
Returns
true
if tunnelled end-to-end through at least
one proxy,
false
otherwise