Helps tracking the steps in establishing a route. More...
The following notice applies to the original API on which this API is based, and to its documentation. The documentation of this API has been revised from the original.
/* * Copyright (C) 2006 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
Public Member Functions | |
RouteTracker (HttpHost target, InetAddress local) | |
Creates a new route tracker. More... | |
RouteTracker (HttpRoute route) | |
Creates a new tracker for the given route. More... | |
final void | connectTarget (boolean secure) |
Tracks connecting to the target. More... | |
final void | connectProxy (HttpHost proxy, boolean secure) |
Tracks connecting to the first proxy. More... | |
final void | tunnelTarget (boolean secure) |
Tracks tunnelling to the target. More... | |
final void | tunnelProxy (HttpHost proxy, boolean secure) |
Tracks tunnelling to a proxy in a proxy chain. More... | |
final void | layerProtocol (boolean secure) |
Tracks layering a protocol. More... | |
final HttpHost | getTargetHost () |
Obtains the target host. More... | |
final InetAddress | getLocalAddress () |
Obtains the local address to connect from. More... | |
final int | getHopCount () |
Obtains the number of hops in this route. More... | |
final HttpHost | getHopTarget (int hop) |
Obtains the target of a hop in this route. More... | |
final HttpHost | getProxyHost () |
Obtains the first proxy host. More... | |
final TunnelType | getTunnelType () |
Obtains the tunnel type of this route. More... | |
final boolean | isTunnelled () |
Checks whether this route is tunnelled through a proxy. More... | |
final LayerType | getLayerType () |
Obtains the layering type of this route. More... | |
final boolean | isLayered () |
Checks whether this route includes a layered protocol. More... | |
final boolean | isSecure () |
Checks whether this route is secure. More... | |
final HttpRoute | toRoute () |
Obtains the tracked route. More... | |
final boolean | equals (Object o) |
Compares this tracked route to another. More... | |
final int | hashCode () |
Generates a hash code for this tracked route. More... | |
final String | toString () |
Obtains a description of the tracked route. More... | |
RouteTracker | ( | HttpHost | target, |
InetAddress | local | ||
) |
The target and origin need to be specified at creation time.
target | the host to which to route |
local | the local address to route from, or null for the default |
RouteTracker | ( | HttpRoute | route | ) |
Only target and origin are taken from the route, everything else remains to be tracked.
route | the route to track |
final void connectTarget | ( | boolean | secure | ) |
secure | true if the route is secure, false otherwise |
final void connectProxy | ( | HttpHost | proxy, |
boolean | secure | ||
) |
proxy | the proxy connected to |
secure | true if the route is secure, false otherwise |
final void tunnelTarget | ( | boolean | secure | ) |
secure | true if the route is secure, false otherwise |
final void tunnelProxy | ( | HttpHost | proxy, |
boolean | secure | ||
) |
This will extend the tracked proxy chain, but it does not mark the route as tunnelled. Only end-to-end tunnels are considered there.
proxy | the proxy tunnelled to |
secure | true if the route is secure, false otherwise |
final void layerProtocol | ( | boolean | secure | ) |
secure | true if the route is secure, false otherwise |
final InetAddress getLocalAddress | ( | ) |
null
Implements RouteInfo.
final int getHopCount | ( | ) |
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.
Implements RouteInfo.
final HttpHost getHopTarget | ( | int | hop | ) |
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.
hop | index of the hop for which to get the target, 0 for first |
IllegalArgumentException | if the argument is negative or not less than getHopCount() |
Implements RouteInfo.
final HttpHost getProxyHost | ( | ) |
null
if this route is direct Implements RouteInfo.
final TunnelType getTunnelType | ( | ) |
If there is a proxy chain, only end-to-end tunnels are considered.
Implements RouteInfo.
final boolean isTunnelled | ( | ) |
If there is a proxy chain, only end-to-end tunnels are considered.
true
if tunnelled end-to-end through at least one proxy, false
otherwise Implements RouteInfo.
final LayerType getLayerType | ( | ) |
In the presence of proxies, only layering over an end-to-end tunnel is considered.
Implements RouteInfo.
final boolean isLayered | ( | ) |
In the presence of proxies, only layering over an end-to-end tunnel is considered.
true
if layered, false
otherwise Implements RouteInfo.
final boolean isSecure | ( | ) |
true
if secure, false
otherwise Implements RouteInfo.
final HttpRoute toRoute | ( | ) |
If a route has been tracked, it is connected. If not connected, nothing has been tracked so far.
null
if nothing has been tracked so far final boolean equals | ( | Object | o | ) |
o | the object to compare with |
true
if the argument is the same tracked route, false
final int hashCode | ( | ) |
Route trackers are modifiable and should therefore not be used as lookup keys. Use toRoute to obtain an unmodifiable representation of the tracked route.
final String toString | ( | ) |