Android APIs
Added in API level 1
Deprecated since API level 22
public interface

RouteInfo

org.apache.http.conn.routing.RouteInfo
Known Indirect Subclasses

This interface was deprecated in API level 22.
Please use openConnection() instead. Please visit this webpage for further details.

Class Overview

Read-only interface for route information.

Summary

Nested Classes
enum RouteInfo.LayerType The layering type of a route. 
enum RouteInfo.TunnelType The tunnelling type of a route. 
Public Methods
abstract int getHopCount()
Obtains the number of hops in this route.
abstract HttpHost getHopTarget(int hop)
Obtains the target of a hop in this route.
abstract RouteInfo.LayerType getLayerType()
Obtains the layering type of this route.
abstract InetAddress getLocalAddress()
Obtains the local address to connect from.
abstract HttpHost getProxyHost()
Obtains the first proxy host.
abstract HttpHost getTargetHost()
Obtains the target host.
abstract RouteInfo.TunnelType getTunnelType()
Obtains the tunnel type of this route.
abstract boolean isLayered()
Checks whether this route includes a layered protocol.
abstract boolean isSecure()
Checks whether this route is secure.
abstract boolean isTunnelled()
Checks whether this route is tunnelled through a proxy.

Public Methods

public abstract int getHopCount ()

Added in API level 1

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 abstract HttpHost getHopTarget (int hop)

Added in API level 1

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
Throws
IllegalArgumentException if the argument is negative or not less than getHopCount()

public abstract RouteInfo.LayerType getLayerType ()

Added in API level 1

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

Returns
  • the layering type

public abstract InetAddress getLocalAddress ()

Added in API level 1

Obtains the local address to connect from.

Returns
  • the local address, or null

public abstract HttpHost getProxyHost ()

Added in API level 1

Obtains the first proxy host.

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

public abstract HttpHost getTargetHost ()

Added in API level 1

Obtains the target host.

Returns
  • the target host

public abstract RouteInfo.TunnelType getTunnelType ()

Added in API level 1

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

Returns
  • the tunnelling type

public abstract boolean isLayered ()

Added in API level 1

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 abstract boolean isSecure ()

Added in API level 1

Checks whether this route is secure.

Returns
  • true if secure, false otherwise

public abstract boolean isTunnelled ()

Added in API level 1

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