RouteInfo.LayerType, RouteInfo.TunnelType| Constructor and Description |
|---|
HttpRoute(org.apache.hc.core5.http.HttpHost target)
Creates a new direct insecure route.
|
HttpRoute(org.apache.hc.core5.http.HttpHost target,
org.apache.hc.core5.http.HttpHost proxy)
Creates a new plain route through a proxy.
|
HttpRoute(org.apache.hc.core5.http.HttpHost target,
InetAddress local,
boolean secure)
Creates a new direct route.
|
HttpRoute(org.apache.hc.core5.http.HttpHost target,
InetAddress local,
org.apache.hc.core5.http.HttpHost[] proxies,
boolean secure,
RouteInfo.TunnelType tunnelled,
RouteInfo.LayerType layered)
Creates a new route with all attributes specified explicitly.
|
HttpRoute(org.apache.hc.core5.http.HttpHost target,
InetAddress local,
org.apache.hc.core5.http.HttpHost proxy,
boolean secure)
Creates a new route through a proxy.
|
HttpRoute(org.apache.hc.core5.http.HttpHost target,
InetAddress local,
org.apache.hc.core5.http.HttpHost proxy,
boolean secure,
RouteInfo.TunnelType tunnelled,
RouteInfo.LayerType layered)
Creates a new route with at most one proxy.
|
HttpRoute(org.apache.hc.core5.http.HttpHost target,
org.apache.hc.core5.net.NamedEndpoint targetName,
InetAddress local,
boolean secure)
Creates a new direct route.
|
HttpRoute(org.apache.hc.core5.http.HttpHost target,
org.apache.hc.core5.net.NamedEndpoint targetName,
InetAddress local,
org.apache.hc.core5.http.HttpHost[] proxies,
boolean secure,
RouteInfo.TunnelType tunnelled,
RouteInfo.LayerType layered)
Creates a new route with all attributes specified explicitly.
|
HttpRoute(org.apache.hc.core5.http.HttpHost target,
org.apache.hc.core5.net.NamedEndpoint targetName,
InetAddress local,
org.apache.hc.core5.http.HttpHost proxy,
boolean secure)
Creates a new route through a proxy.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone() |
boolean |
equals(Object obj)
Compares this route to another.
|
int |
getHopCount()
Obtains the number of hops in this route.
|
org.apache.hc.core5.http.HttpHost |
getHopTarget(int hop)
Obtains the target of a hop in this route.
|
RouteInfo.LayerType |
getLayerType()
Obtains the layering type of this route.
|
InetAddress |
getLocalAddress()
Obtains the local address to connect from.
|
InetSocketAddress |
getLocalSocketAddress() |
org.apache.hc.core5.http.HttpHost |
getProxyHost()
Obtains the first proxy host.
|
org.apache.hc.core5.http.HttpHost |
getTargetHost()
Obtains the target host.
|
org.apache.hc.core5.net.NamedEndpoint |
getTargetName()
Obtains the target name, if different from the target host,
null otherwise. |
RouteInfo.TunnelType |
getTunnelType()
Obtains the tunnel type of this route.
|
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.
|
String |
toString()
Obtains a description of this route.
|
public HttpRoute(org.apache.hc.core5.http.HttpHost target,
InetAddress local,
org.apache.hc.core5.http.HttpHost[] proxies,
boolean secure,
RouteInfo.TunnelType tunnelled,
RouteInfo.LayerType 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 - the tunnel type of this routelayered - the layering type of this routepublic HttpRoute(org.apache.hc.core5.http.HttpHost target,
org.apache.hc.core5.net.NamedEndpoint targetName,
InetAddress local,
org.apache.hc.core5.http.HttpHost[] proxies,
boolean secure,
RouteInfo.TunnelType tunnelled,
RouteInfo.LayerType layered)
target - the host to which to routetargetName - the target targetName if differs from the target host.local - 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 - the tunnel type of this routelayered - the layering type of this routepublic HttpRoute(org.apache.hc.core5.http.HttpHost target,
InetAddress local,
org.apache.hc.core5.http.HttpHost proxy,
boolean secure,
RouteInfo.TunnelType tunnelled,
RouteInfo.LayerType 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.hc.core5.http.HttpHost target,
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.hc.core5.http.HttpHost target,
org.apache.hc.core5.net.NamedEndpoint targetName,
InetAddress local,
boolean secure)
target - the host to which to routetargetName - the target targetName if differs from the target host.local - the local address to route from, or
null for the defaultsecure - true if the route is (to be) secure,
false otherwisepublic HttpRoute(org.apache.hc.core5.http.HttpHost target)
target - the host to which to routepublic HttpRoute(org.apache.hc.core5.http.HttpHost target,
org.apache.hc.core5.net.NamedEndpoint targetName,
InetAddress local,
org.apache.hc.core5.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 routetargetName - the target targetName if differs from the target host.local - the local address to route from, or
null for the defaultproxy - the proxy to usesecure - true if the route is (to be) secure,
false otherwisepublic HttpRoute(org.apache.hc.core5.http.HttpHost target,
InetAddress local,
org.apache.hc.core5.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 otherwisepublic HttpRoute(org.apache.hc.core5.http.HttpHost target,
org.apache.hc.core5.http.HttpHost proxy)
target - the host to which to routeproxy - the proxy to usepublic org.apache.hc.core5.http.HttpHost getTargetHost()
RouteInfogetTargetHost in interface RouteInfopublic org.apache.hc.core5.net.NamedEndpoint getTargetName()
RouteInfonull otherwise.getTargetName in interface RouteInfopublic InetAddress getLocalAddress()
RouteInfogetLocalAddress in interface RouteInfonullpublic InetSocketAddress getLocalSocketAddress()
public int getHopCount()
RouteInfogetHopCount in interface RouteInfopublic org.apache.hc.core5.http.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 in interface RouteInfohop - index of the hop for which to get the target,
0 for firstpublic org.apache.hc.core5.http.HttpHost getProxyHost()
RouteInfogetProxyHost in interface RouteInfonull if this route is directpublic RouteInfo.TunnelType getTunnelType()
RouteInfogetTunnelType in interface RouteInfopublic boolean isTunnelled()
RouteInfoisTunnelled in interface RouteInfotrue if tunnelled end-to-end through at least
one proxy,
false otherwisepublic RouteInfo.LayerType getLayerType()
RouteInfogetLayerType in interface RouteInfopublic boolean isLayered()
RouteInfopublic boolean isSecure()
RouteInfopublic boolean equals(Object obj)
public int hashCode()
public String toString()
public Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionCopyright © 1999–2021 The Apache Software Foundation. All rights reserved.