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()
This will build a fallback (zero-hop) tunnel ONLY if
this pool is exploratory, or the settings allow it.
|
(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(net.i2p.data.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 net.i2p.data.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(net.i2p.data.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,
net.i2p.data.Hash blamePeer)
Remove the tunnel and blame only one peer.
|
getRateName, getSettings, getTunnelCount, setSettingsAliasedTunnelPool(RouterContext ctx, TunnelPoolManager mgr, TunnelPoolSettings settings, TunnelPool aliasOf)
void startup()
TunnelPoolstartup in class TunnelPoolvoid shutdown()
shutdown in class TunnelPoolTunnelInfo selectTunnel()
TunnelPoolselectTunnel in class TunnelPoolTunnelInfo selectTunnel(net.i2p.data.Hash closestTo)
TunnelPoolselectTunnel in class TunnelPoolpublic TunnelInfo getTunnel(net.i2p.data.TunnelId gatewayId)
getTunnel in class TunnelPoolpublic List<TunnelInfo> listTunnels()
TunnelPoollistTunnels in class TunnelPoolboolean needFallback()
TunnelPoolneedFallback in class TunnelPoolpublic List<PooledTunnelCreatorConfig> listPending()
TunnelPoollistPending in class TunnelPoolpublic boolean isAlive()
TunnelPoolisAlive in class TunnelPoolpublic int size()
TunnelPoolsize in class TunnelPoolvoid addTunnel(TunnelInfo info)
TunnelPooladdTunnel in class TunnelPoolvoid removeTunnel(TunnelInfo info)
TunnelPoolremoveTunnel in class TunnelPoolvoid tunnelFailed(TunnelInfo cfg)
TunnelPooltunnelFailed in class TunnelPoolvoid tunnelFailed(TunnelInfo cfg, net.i2p.data.Hash blamePeer)
TunnelPooltunnelFailed in class TunnelPoolvoid refreshLeaseSet()
TunnelPoolrefreshLeaseSet in class TunnelPoolboolean buildFallback()
TunnelPoolbuildFallback in class TunnelPoolprotected net.i2p.data.LeaseSet locked_buildNewLeaseSet()
TunnelPoollocked_buildNewLeaseSet in class TunnelPoolpublic long getLifetimeProcessed()
getLifetimeProcessed in class TunnelPoolint countHowManyToBuild()
TunnelPoolcountHowManyToBuild in class TunnelPoolPooledTunnelCreatorConfig configureNewTunnel()
configureNewTunnel in class TunnelPoolvoid buildComplete(PooledTunnelCreatorConfig cfg)
TunnelPoolbuildComplete in class TunnelPoolpublic String toString()
toString in class TunnelPool