Top Description Inners Methods
org.apache.http.conn.routing

public Interface RouteInfo

Known Direct Implementers
org.apache.http.conn.routing.RouteTracker, org.apache.http.conn.routing.HttpRoute
Imports
java.net.InetAddress, org.apache.http.HttpHost

Read-only interface for route information.
Since
4.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
RouteInfo.LayerType

The layering type of a route.

public static enum
RouteInfo.TunnelType

The tunnelling type of a route.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the number of hops in this route
getHopCount
()

Obtains the number of hops in this route.

public HttpHost

Returns:

the target of the given hop
getHopTarget
(int
index of the hop for which to get the target, 0 for first
hop
)

Obtains the target of a hop in this route.

public RouteInfo.LayerType

Returns:

the layering type
getLayerType
()

Obtains the layering type of this route.

public InetAddress

Returns:

the local address, or null
getLocalAddress
()

Obtains the local address to connect from.

public HttpHost

Returns:

the first proxy in the proxy chain, or null if this route is direct
getProxyHost
()

Obtains the first proxy host.

public HttpHost

Returns:

the target host
getTargetHost
()

Obtains the target host.

public RouteInfo.TunnelType

Returns:

the tunnelling type
getTunnelType
()

Obtains the tunnel type of this route.

public boolean

Returns:

true if layered, false otherwise
isLayered
()

Checks whether this route includes a layered protocol.

public boolean

Returns:

true if secure, false otherwise
isSecure
()

Checks whether this route is secure.

public boolean

Returns:

true if tunnelled end-to-end through at least one proxy, false otherwise
isTunnelled
()

Checks whether this route is tunnelled through a proxy.

Method Detail

getHopCountback to summary
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:int

the number of hops in this route

getHopTargetback to summary
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:int

index of the hop for which to get the target, 0 for first

Returns:HttpHost

the target of the given hop

Exceptions
IllegalArgumentException:
if the argument is negative or not less than getHopCount()
getLayerTypeback to summary
public RouteInfo.LayerType getLayerType()

Obtains the layering type of this route. In the presence of proxies, only layering over an end-to-end tunnel is considered.

Returns:RouteInfo.LayerType

the layering type

getLocalAddressback to summary
public InetAddress getLocalAddress()

Obtains the local address to connect from.

Returns:InetAddress

the local address, or null

getProxyHostback to summary
public HttpHost getProxyHost()

Obtains the first proxy host.

Returns:HttpHost

the first proxy in the proxy chain, or null if this route is direct

getTargetHostback to summary
public HttpHost getTargetHost()

Obtains the target host.

Returns:HttpHost

the target host

getTunnelTypeback to summary
public RouteInfo.TunnelType getTunnelType()

Obtains the tunnel type of this route. If there is a proxy chain, only end-to-end tunnels are considered.

Returns:RouteInfo.TunnelType

the tunnelling type

isLayeredback to summary
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:boolean

true if layered, false otherwise

isSecureback to summary
public boolean isSecure()

Checks whether this route is secure.

Returns:boolean

true if secure, false otherwise

isTunnelledback to summary
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:boolean

true if tunnelled end-to-end through at least one proxy, false otherwise

org.apache.http.conn.routing back to summary

public final Enum RouteInfo.LayerType

extends Enum<RouteInfo.LayerType>
Class Inheritance

The layering type of a route. Plain routes are established by connecting or tunnelling. Layered routes are established by layering a protocol such as TLS/SSL over an existing connection. Protocols can only be layered over a tunnel to the target, or or over a direct connection without proxies.

Layering a protocol over a direct connection makes little sense, since the connection could be established with the new protocol in the first place. But we don't want to exclude that use case.

Field Summary

Modifier and TypeField and Description
public static final RouteInfo.LayerType
public static final RouteInfo.LayerType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static RouteInfo.LayerType
public static RouteInfo.LayerType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

LAYEREDback to summary
public static final RouteInfo.LayerType LAYERED
PLAINback to summary
public static final RouteInfo.LayerType PLAIN

Constructor Detail

LayerTypeback to summary
private LayerType()

Method Detail

valueOfback to summary
public static RouteInfo.LayerType valueOf(String name)
valuesback to summary
public static RouteInfo.LayerType[] values()
org.apache.http.conn.routing back to summary

public final Enum RouteInfo.TunnelType

extends Enum<RouteInfo.TunnelType>
Class Inheritance

The tunnelling type of a route. Plain routes are established by connecting to the target or the first proxy. Tunnelled routes are established by connecting to the first proxy and tunnelling through all proxies to the target. Routes without a proxy cannot be tunnelled.

Field Summary

Modifier and TypeField and Description
public static final RouteInfo.TunnelType
public static final RouteInfo.TunnelType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static RouteInfo.TunnelType
public static RouteInfo.TunnelType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

PLAINback to summary
public static final RouteInfo.TunnelType PLAIN
TUNNELLEDback to summary
public static final RouteInfo.TunnelType TUNNELLED

Constructor Detail

TunnelTypeback to summary
private TunnelType()

Method Detail

valueOfback to summary
public static RouteInfo.TunnelType valueOf(String name)
valuesback to summary
public static RouteInfo.TunnelType[] values()