public class AliasedTunnelPool extends TunnelPool
_alive, _context, _log
Constructor and Description |
---|
AliasedTunnelPool(RouterContext ctx,
TunnelPoolManager mgr,
TunnelPoolSettings settings,
TunnelPool aliasOf) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addTunnel(TunnelInfo info)
Add to the pool.
|
(package private) void |
buildComplete(PooledTunnelCreatorConfig cfg)
Remove from the _inprogress list
|
(package private) boolean |
buildFallback() |
(package private) PooledTunnelCreatorConfig |
configureNewTunnel() |
(package private) int |
countHowManyToBuild()
Gather the data to see how many tunnels to build, and then actually compute that value (delegated to
the countHowManyToBuild function below)
|
long |
getLifetimeProcessed() |
TunnelInfo |
getTunnel(TunnelId gatewayId) |
boolean |
isAlive()
Is this pool running AND either exploratory, or tracked by the client manager?
A pool will be alive but not tracked after the client manager removes it
but before all the tunnels have expired.
|
List<PooledTunnelCreatorConfig> |
listPending()
list of tunnelInfo instances of tunnels currently being built
|
List<TunnelInfo> |
listTunnels()
Return a list of tunnels in the pool
|
protected LeaseSet |
locked_buildNewLeaseSet()
Build a leaseSet with the required tunnels that aren't about to expire.
|
(package private) boolean |
needFallback()
Do we really need more fallbacks?
Used to prevent a zillion of them
|
(package private) void |
refreshLeaseSet()
noop for outbound and exploratory
|
(package private) void |
removeTunnel(TunnelInfo info)
Remove from the pool.
|
(package private) TunnelInfo |
selectTunnel()
Pull a random tunnel out of the pool.
|
(package private) TunnelInfo |
selectTunnel(Hash closestTo)
Return the tunnel from the pool that is XOR-closet to the target.
|
(package private) void |
shutdown() |
int |
size()
duplicate of getTunnelCount(), let's pick one
|
(package private) void |
startup()
Warning, this may be called more than once
(without an intervening shutdown()) if the
tunnel is stopped and then restarted by the client manager with the same
Destination (i.e.
|
String |
toString() |
(package private) void |
tunnelFailed(TunnelInfo cfg)
Remove the tunnel and blame all the peers (not necessarily equally).
|
(package private) void |
tunnelFailed(TunnelInfo cfg,
Hash blamePeer)
Remove the tunnel and blame only one peer.
|
getSettings, getTunnelCount, setSettings
AliasedTunnelPool(RouterContext ctx, TunnelPoolManager mgr, TunnelPoolSettings settings, TunnelPool aliasOf)
void startup()
TunnelPool
startup
in class TunnelPool
void shutdown()
shutdown
in class TunnelPool
TunnelInfo selectTunnel()
TunnelPool
selectTunnel
in class TunnelPool
TunnelInfo selectTunnel(Hash closestTo)
TunnelPool
selectTunnel
in class TunnelPool
public TunnelInfo getTunnel(TunnelId gatewayId)
getTunnel
in class TunnelPool
public List<TunnelInfo> listTunnels()
TunnelPool
listTunnels
in class TunnelPool
boolean needFallback()
TunnelPool
needFallback
in class TunnelPool
public List<PooledTunnelCreatorConfig> listPending()
TunnelPool
listPending
in class TunnelPool
public boolean isAlive()
TunnelPool
isAlive
in class TunnelPool
public int size()
TunnelPool
size
in class TunnelPool
void addTunnel(TunnelInfo info)
TunnelPool
addTunnel
in class TunnelPool
void removeTunnel(TunnelInfo info)
TunnelPool
removeTunnel
in class TunnelPool
void tunnelFailed(TunnelInfo cfg)
TunnelPool
tunnelFailed
in class TunnelPool
void tunnelFailed(TunnelInfo cfg, Hash blamePeer)
TunnelPool
tunnelFailed
in class TunnelPool
void refreshLeaseSet()
TunnelPool
refreshLeaseSet
in class TunnelPool
boolean buildFallback()
buildFallback
in class TunnelPool
protected LeaseSet locked_buildNewLeaseSet()
TunnelPool
locked_buildNewLeaseSet
in class TunnelPool
public long getLifetimeProcessed()
getLifetimeProcessed
in class TunnelPool
int countHowManyToBuild()
TunnelPool
countHowManyToBuild
in class TunnelPool
PooledTunnelCreatorConfig configureNewTunnel()
configureNewTunnel
in class TunnelPool
void buildComplete(PooledTunnelCreatorConfig cfg)
TunnelPool
buildComplete
in class TunnelPool
public String toString()
toString
in class TunnelPool