|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.conn.HttpRoute
public final class HttpRoute
The route for a request. Instances of this class are unmodifiable and therefore suitable for use as lookup keys.
Constructor Summary | |
---|---|
HttpRoute(org.apache.http.HttpHost target)
Creates a new direct insecure route. |
|
HttpRoute(org.apache.http.HttpHost target,
java.net.InetAddress local,
boolean secure)
Creates a new direct route. |
|
HttpRoute(org.apache.http.HttpHost target,
java.net.InetAddress local,
org.apache.http.HttpHost[] proxies,
boolean secure,
boolean tunnelled,
boolean layered)
Creates a new route with all attributes specified explicitly. |
|
HttpRoute(org.apache.http.HttpHost target,
java.net.InetAddress local,
org.apache.http.HttpHost proxy,
boolean secure)
Creates a new route through a proxy. |
|
HttpRoute(org.apache.http.HttpHost target,
java.net.InetAddress local,
org.apache.http.HttpHost proxy,
boolean secure,
boolean tunnelled,
boolean layered)
Creates a new route with at most one proxy. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
boolean |
equals(java.lang.Object o)
Compares this route to another. |
int |
getHopCount()
Obtains the number of hops in this route. |
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 route. |
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. |
java.lang.String |
toString()
Obtains a description of this route. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HttpRoute(org.apache.http.HttpHost target, java.net.InetAddress local, org.apache.http.HttpHost[] proxies, boolean secure, boolean tunnelled, boolean layered)
target
- the host to which to routelocal
- the local address to route from, or
null
for the defaultproxies
- the proxy chain to use, or
null
for a direct routesecure
- true
if the route is (to be) secure,
false
otherwisetunnelled
- true
if the route is (to be) tunnelled
end-to-end via the proxy chain,
false
otherwiselayered
- true
if the route includes a
layered protocol,
false
otherwisepublic HttpRoute(org.apache.http.HttpHost target, java.net.InetAddress local, org.apache.http.HttpHost proxy, boolean secure, boolean tunnelled, boolean layered)
target
- the host to which to routelocal
- the local address to route from, or
null
for the defaultproxy
- the proxy to use, or
null
for a direct routesecure
- true
if the route is (to be) secure,
false
otherwisetunnelled
- true
if the route is (to be) tunnelled
via the proxy,
false
otherwiselayered
- true
if the route includes a
layered protocol,
false
otherwisepublic HttpRoute(org.apache.http.HttpHost target, java.net.InetAddress local, boolean secure)
target
- the host to which to routelocal
- the local address to route from, or
null
for the defaultsecure
- true
if the route is (to be) secure,
false
otherwisepublic HttpRoute(org.apache.http.HttpHost target)
target
- the host to which to routepublic HttpRoute(org.apache.http.HttpHost target, java.net.InetAddress local, org.apache.http.HttpHost proxy, boolean secure)
proxy
MUST be given.
For convenience, it is assumed that a secure connection will be
layered over a tunnel through the proxy.
target
- the host to which to routelocal
- the local address to route from, or
null
for the defaultproxy
- the proxy to usesecure
- true
if the route is (to be) secure,
false
otherwiseMethod Detail |
---|
public 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)
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.
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 this route is directpublic final boolean isTunnelled()
true
if tunnelled end-to-end through at least
one proxy,
false
otherwisepublic final boolean isLayered()
true
if layered,
false
otherwisepublic final boolean isSecure()
true
if secure,
false
otherwisepublic 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 route,
false
public final int hashCode()
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 |