• BlackBerry Dynamics
  • Runtime library for Android applications
  • 12.0.1.79
RouteTracker Class Reference

Helps tracking the steps in establishing a route. More...

Inheritance diagram for RouteTracker:
RouteInfo

Description

Author
Roland Weber
Version
Revision
620254
Since
4.0

Notice

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...
 

Constructor & Destructor Documentation

◆ RouteTracker() [1/2]

RouteTracker ( HttpHost  target,
InetAddress  local 
)

The target and origin need to be specified at creation time.

Parameters
targetthe host to which to route
localthe local address to route from, or null for the default

◆ RouteTracker() [2/2]

RouteTracker ( HttpRoute  route)

Only target and origin are taken from the route, everything else remains to be tracked.

Parameters
routethe route to track

Member Function Documentation

◆ connectTarget()

final void connectTarget ( boolean  secure)
Parameters
securetrue if the route is secure, false otherwise

◆ connectProxy()

final void connectProxy ( HttpHost  proxy,
boolean  secure 
)
Parameters
proxythe proxy connected to
securetrue if the route is secure, false otherwise

◆ tunnelTarget()

final void tunnelTarget ( boolean  secure)
Parameters
securetrue if the route is secure, false otherwise

◆ tunnelProxy()

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.

Parameters
proxythe proxy tunnelled to
securetrue if the route is secure, false otherwise

◆ layerProtocol()

final void layerProtocol ( boolean  secure)
Parameters
securetrue if the route is secure, false otherwise

◆ getTargetHost()

final HttpHost getTargetHost ( )
Returns
the target host

Implements RouteInfo.

◆ getLocalAddress()

final InetAddress getLocalAddress ( )
Returns
the local address, or null

Implements RouteInfo.

◆ getHopCount()

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.

Returns
the number of hops in this route

Implements RouteInfo.

◆ getHopTarget()

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.

Parameters
hopindex of the hop for which to get the target, 0 for first
Returns
the target of the given hop
Exceptions
IllegalArgumentExceptionif the argument is negative or not less than getHopCount()

Implements RouteInfo.

◆ getProxyHost()

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

Implements RouteInfo.

◆ getTunnelType()

final TunnelType getTunnelType ( )

If there is a proxy chain, only end-to-end tunnels are considered.

Returns
the tunnelling type

Implements RouteInfo.

◆ isTunnelled()

final boolean isTunnelled ( )

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

Implements RouteInfo.

◆ getLayerType()

final LayerType getLayerType ( )

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

Returns
the layering type

Implements RouteInfo.

◆ isLayered()

final boolean isLayered ( )

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

Returns
true if layered, false otherwise

Implements RouteInfo.

◆ isSecure()

final boolean isSecure ( )
Returns
true if secure, false otherwise

Implements RouteInfo.

◆ toRoute()

final HttpRoute toRoute ( )

If a route has been tracked, it is connected. If not connected, nothing has been tracked so far.

Returns
the tracked route, or null if nothing has been tracked so far

◆ equals()

final boolean equals ( Object  o)
Parameters
othe object to compare with
Returns
true if the argument is the same tracked route, false

◆ hashCode()

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.

Returns
the hash code

◆ toString()

final String toString ( )
Returns
a human-readable representation of the tracked route