net.i2p.router.tunnel.pool
Class TunnelPeerSelector

java.lang.Object
  extended bynet.i2p.router.tunnel.pool.TunnelPeerSelector
Direct Known Subclasses:
ClientPeerSelector, ExploratoryPeerSelector

abstract class TunnelPeerSelector
extends java.lang.Object

Coordinate the selection of peers to go into a tunnel for one particular pool.


Constructor Summary
(package private) TunnelPeerSelector()
           
 
Method Summary
protected  boolean filterUnreachable(RouterContext ctx, boolean isInbound, boolean isExploratory)
           
 java.util.Set getExclude(RouterContext ctx, boolean isInbound, boolean isExploratory)
          Pick peers that we want to avoid
protected  int getLength(RouterContext ctx, TunnelPoolSettings settings)
           
protected  java.util.List selectExplicit(RouterContext ctx, TunnelPoolSettings settings, int length)
           
abstract  java.util.List selectPeers(RouterContext ctx, TunnelPoolSettings settings)
          Which peers should go into the next tunnel for the given settings?
protected  boolean shouldSelectExplicit(TunnelPoolSettings settings)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TunnelPeerSelector

TunnelPeerSelector()
Method Detail

selectPeers

public abstract java.util.List selectPeers(RouterContext ctx,
                                           TunnelPoolSettings settings)
Which peers should go into the next tunnel for the given settings?

Returns:
ordered list of Hash objects (one per peer) specifying what order they should appear in a tunnel (endpoint first). This includes the local router in the list. If there are no tunnels or peers to build through, and the settings reject 0 hop tunnels, this will return null.

getLength

protected int getLength(RouterContext ctx,
                        TunnelPoolSettings settings)

shouldSelectExplicit

protected boolean shouldSelectExplicit(TunnelPoolSettings settings)

selectExplicit

protected java.util.List selectExplicit(RouterContext ctx,
                                        TunnelPoolSettings settings,
                                        int length)

getExclude

public java.util.Set getExclude(RouterContext ctx,
                                boolean isInbound,
                                boolean isExploratory)
Pick peers that we want to avoid


filterUnreachable

protected boolean filterUnreachable(RouterContext ctx,
                                    boolean isInbound,
                                    boolean isExploratory)