net.i2p.router.tunnel.pool
Class TunnelPool

java.lang.Object
  extended bynet.i2p.router.tunnel.pool.TunnelPool

public class TunnelPool
extends java.lang.Object


Constructor Summary
TunnelPool(RouterContext ctx, TunnelPoolManager mgr, TunnelPoolSettings settings, TunnelPeerSelector sel, TunnelBuilder builder)
           
 
Method Summary
 void addTunnel(TunnelInfo info)
           
(package private)  void buildFallback()
           
 TunnelBuilder getBuilder()
           
 long getLifetimeProcessed()
           
 TunnelPeerSelector getSelector()
           
 TunnelPoolSettings getSettings()
           
 TunnelInfo getTunnel(TunnelId gatewayId)
           
(package private)  int getTunnelCount()
           
 boolean isAlive()
           
 java.util.List listTunnels()
          Return a list of tunnels in the pool
(package private)  int refreshBuilders()
          Fire up as many buildTunnel tasks as necessary, returning how many were added
(package private)  void refreshLeaseSet()
           
(package private)  void refreshSettings()
           
 void removeTunnel(TunnelInfo info)
           
 TunnelInfo selectTunnel()
          Pull a random tunnel out of the pool.
 void setSettings(TunnelPoolSettings settings)
           
 void shutdown()
           
 int size()
           
 void startup()
           
 java.lang.String toString()
           
 void tunnelFailed(PooledTunnelCreatorConfig cfg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TunnelPool

public TunnelPool(RouterContext ctx,
                  TunnelPoolManager mgr,
                  TunnelPoolSettings settings,
                  TunnelPeerSelector sel,
                  TunnelBuilder builder)
Method Detail

startup

public void startup()

shutdown

public void shutdown()

refreshBuilders

int refreshBuilders()
Fire up as many buildTunnel tasks as necessary, returning how many were added


refreshSettings

void refreshSettings()

selectTunnel

public TunnelInfo selectTunnel()
Pull a random tunnel out of the pool. If there are none available but the pool is configured to allow 0hop tunnels, this builds a fake one and returns it.


getTunnel

public TunnelInfo getTunnel(TunnelId gatewayId)

listTunnels

public java.util.List listTunnels()
Return a list of tunnels in the pool

Returns:
list of TunnelInfo objects

getTunnelCount

int getTunnelCount()

getBuilder

public TunnelBuilder getBuilder()

getSettings

public TunnelPoolSettings getSettings()

setSettings

public void setSettings(TunnelPoolSettings settings)

getSelector

public TunnelPeerSelector getSelector()

isAlive

public boolean isAlive()

size

public int size()

addTunnel

public void addTunnel(TunnelInfo info)

removeTunnel

public void removeTunnel(TunnelInfo info)

tunnelFailed

public void tunnelFailed(PooledTunnelCreatorConfig cfg)

refreshLeaseSet

void refreshLeaseSet()

buildFallback

void buildFallback()

getLifetimeProcessed

public long getLifetimeProcessed()

toString

public java.lang.String toString()