public class TunnelPoolManager extends Object implements TunnelManagerFacade
| Constructor and Description |
|---|
TunnelPoolManager(RouterContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAlias(net.i2p.data.Destination dest,
ClientTunnelSettings settings,
net.i2p.data.Destination existingClient)
Add another destination to the same tunnels.
|
(package private) void |
buildComplete(PooledTunnelCreatorConfig cfg)
queue a recurring test job if appropriate
|
void |
buildTunnels(net.i2p.data.Destination client,
ClientTunnelSettings settings)
Used only at session startup.
|
void |
fail(net.i2p.data.Hash peer)
Fail all outbound tunnels with this peer as first hop,
and all inbound tunnels with this peer as the last hop,
baecause we can't contact it any more.
|
(package private) BuildExecutor |
getExecutor() |
int |
getFreeTunnelCount()
how many free inbound tunnels do we have available?
|
int |
getInboundBuildQueueSize()
count how many inbound tunnel requests we have received but not yet processed
|
Map<net.i2p.data.Hash,TunnelPool> |
getInboundClientPools()
for TunnelRenderer in router console
|
int |
getInboundClientTunnelCount()
how many free inbound client tunnels do we have available?
|
TunnelPool |
getInboundExploratoryPool()
For TunnelRenderer in router console
|
TunnelPool |
getInboundPool(net.i2p.data.Hash client) |
TunnelPoolSettings |
getInboundSettings()
exploratory
|
TunnelPoolSettings |
getInboundSettings(net.i2p.data.Hash client) |
long |
getLastParticipatingExpiration()
When does the last tunnel we are participating in expire?
|
Map<net.i2p.data.Hash,TunnelPool> |
getOutboundClientPools()
for TunnelRenderer in router console
|
int |
getOutboundClientTunnelCount()
how many outbound client tunnels do we have available?
|
int |
getOutboundClientTunnelCount(net.i2p.data.Hash destination)
Use to verify a tunnel pool is alive
|
TunnelPool |
getOutboundExploratoryPool()
For TunnelRenderer in router console
|
TunnelPool |
getOutboundPool(net.i2p.data.Hash client) |
TunnelPoolSettings |
getOutboundSettings()
exploratory
|
TunnelPoolSettings |
getOutboundSettings(net.i2p.data.Hash client) |
int |
getOutboundTunnelCount()
how many outbound tunnels do we have available?
|
int |
getParticipatingCount()
how many tunnels are we participating in?
|
double |
getShareRatio() |
TunnelInfo |
getTunnelInfo(net.i2p.data.TunnelId id)
Deprecated.
unused
|
(package private) boolean |
isShutdown() |
boolean |
isValidTunnel(net.i2p.data.Hash client,
TunnelInfo tunnel)
Is a tunnel a valid member of the pool?
|
void |
listPools(List<TunnelPool> out)
list of TunnelPool instances currently in play
|
void |
removeAlias(net.i2p.data.Destination dest)
Remove a destination for the same tunnels as another.
|
void |
removeTunnels(net.i2p.data.Destination dest)
Must be called AFTER deregistration by the client manager.
|
void |
removeTunnels(net.i2p.data.Hash destination)
This will be called twice, once by the inbound and once by the outbound pool.
|
void |
renderStatusHTML(Writer out)
Deprecated.
moved to routerconsole
|
void |
restart()
Perform a soft restart.
|
TunnelInfo |
selectInboundExploratoryTunnel(net.i2p.data.Hash closestTo)
Pick the inbound exploratory tunnel with the gateway closest to the given hash.
|
TunnelInfo |
selectInboundTunnel()
Pick a random inbound exploratory tunnel.
|
TunnelInfo |
selectInboundTunnel(net.i2p.data.Hash destination)
Pick a random inbound tunnel from the given destination's pool.
|
TunnelInfo |
selectInboundTunnel(net.i2p.data.Hash destination,
net.i2p.data.Hash closestTo)
Pick the inbound tunnel with the gateway closest to the given hash
from the given destination's pool.
|
TunnelInfo |
selectOutboundExploratoryTunnel(net.i2p.data.Hash closestTo)
Pick the outbound exploratory tunnel with the endpoint closest to the given hash.
|
TunnelInfo |
selectOutboundTunnel()
Pick a random outbound exploratory tunnel.
|
TunnelInfo |
selectOutboundTunnel(net.i2p.data.Hash destination)
Pick a random outbound tunnel from the given destination's pool.
|
TunnelInfo |
selectOutboundTunnel(net.i2p.data.Hash destination,
net.i2p.data.Hash closestTo)
Pick the outbound tunnel with the endpoint closest to the given hash
from the given destination's pool.
|
Set<net.i2p.data.Hash> |
selectPeersInTooManyTunnels()
For reliability reasons, don't allow a peer in more than x% of
client and exploratory tunnels.
|
void |
setInboundSettings(net.i2p.data.Hash client,
TunnelPoolSettings settings) |
void |
setInboundSettings(TunnelPoolSettings settings)
exploratory
|
void |
setOutboundSettings(net.i2p.data.Hash client,
TunnelPoolSettings settings) |
void |
setOutboundSettings(TunnelPoolSettings settings)
exploratory
|
void |
shutdown()
Cannot be restarted
|
void |
startup()
Instruct the service that it should start normal operation.
|
(package private) void |
tunnelFailed() |
public TunnelPoolManager(RouterContext ctx)
public TunnelInfo selectInboundTunnel()
selectInboundTunnel in interface TunnelManagerFacadepublic TunnelInfo selectInboundTunnel(net.i2p.data.Hash destination)
selectInboundTunnel in interface TunnelManagerFacadedestination - if null, returns inbound exploratory tunnelpublic TunnelInfo selectOutboundTunnel()
selectOutboundTunnel in interface TunnelManagerFacadepublic TunnelInfo selectOutboundTunnel(net.i2p.data.Hash destination)
selectOutboundTunnel in interface TunnelManagerFacadedestination - if null, returns outbound exploratory tunnelpublic TunnelInfo selectInboundExploratoryTunnel(net.i2p.data.Hash closestTo)
selectInboundExploratoryTunnel in interface TunnelManagerFacadeclosestTo - non-nullpublic TunnelInfo selectInboundTunnel(net.i2p.data.Hash destination, net.i2p.data.Hash closestTo)
selectInboundTunnel in interface TunnelManagerFacadedestination - if null, returns inbound exploratory tunnelclosestTo - non-nullpublic TunnelInfo selectOutboundExploratoryTunnel(net.i2p.data.Hash closestTo)
selectOutboundExploratoryTunnel in interface TunnelManagerFacadeclosestTo - non-nullpublic TunnelInfo selectOutboundTunnel(net.i2p.data.Hash destination, net.i2p.data.Hash closestTo)
selectOutboundTunnel in interface TunnelManagerFacadedestination - if null, returns outbound exploratory tunnelclosestTo - non-null@Deprecated public TunnelInfo getTunnelInfo(net.i2p.data.TunnelId id)
getTunnelInfo in interface TunnelManagerFacadeid - the tunnelId as seen at the gatewaypublic int getFreeTunnelCount()
TunnelManagerFacadegetFreeTunnelCount in interface TunnelManagerFacadepublic int getOutboundTunnelCount()
TunnelManagerFacadegetOutboundTunnelCount in interface TunnelManagerFacadepublic int getInboundClientTunnelCount()
TunnelManagerFacadegetInboundClientTunnelCount in interface TunnelManagerFacadepublic int getOutboundClientTunnelCount()
TunnelManagerFacadegetOutboundClientTunnelCount in interface TunnelManagerFacadepublic int getOutboundClientTunnelCount(net.i2p.data.Hash destination)
getOutboundClientTunnelCount in interface TunnelManagerFacadepublic int getParticipatingCount()
TunnelManagerFacadegetParticipatingCount in interface TunnelManagerFacadepublic long getLastParticipatingExpiration()
TunnelManagerFacadegetLastParticipatingExpiration in interface TunnelManagerFacadepublic double getShareRatio()
getShareRatio in interface TunnelManagerFacadepublic boolean isValidTunnel(net.i2p.data.Hash client,
TunnelInfo tunnel)
TunnelManagerFacadeisValidTunnel in interface TunnelManagerFacadepublic TunnelPoolSettings getInboundSettings()
getInboundSettings in interface TunnelManagerFacadepublic TunnelPoolSettings getOutboundSettings()
getOutboundSettings in interface TunnelManagerFacadepublic void setInboundSettings(TunnelPoolSettings settings)
setInboundSettings in interface TunnelManagerFacadepublic void setOutboundSettings(TunnelPoolSettings settings)
setOutboundSettings in interface TunnelManagerFacadepublic TunnelPoolSettings getInboundSettings(net.i2p.data.Hash client)
getInboundSettings in interface TunnelManagerFacadepublic TunnelPoolSettings getOutboundSettings(net.i2p.data.Hash client)
getOutboundSettings in interface TunnelManagerFacadepublic void setInboundSettings(net.i2p.data.Hash client,
TunnelPoolSettings settings)
setInboundSettings in interface TunnelManagerFacadepublic void setOutboundSettings(net.i2p.data.Hash client,
TunnelPoolSettings settings)
setOutboundSettings in interface TunnelManagerFacadepublic void restart()
Servicepublic void buildTunnels(net.i2p.data.Destination client,
ClientTunnelSettings settings)
buildTunnels in interface TunnelManagerFacadepublic boolean addAlias(net.i2p.data.Destination dest,
ClientTunnelSettings settings,
net.i2p.data.Destination existingClient)
addAlias in interface TunnelManagerFacadeIllegalArgumentException - if notpublic void removeAlias(net.i2p.data.Destination dest)
removeAlias in interface TunnelManagerFacadepublic void removeTunnels(net.i2p.data.Destination dest)
removeTunnels in interface TunnelManagerFacadepublic void removeTunnels(net.i2p.data.Hash destination)
void buildComplete(PooledTunnelCreatorConfig cfg)
public void startup()
Servicepublic void listPools(List<TunnelPool> out)
listPools in interface TunnelManagerFacadevoid tunnelFailed()
BuildExecutor getExecutor()
boolean isShutdown()
public int getInboundBuildQueueSize()
TunnelManagerFacadegetInboundBuildQueueSize in interface TunnelManagerFacade@Deprecated public void renderStatusHTML(Writer out) throws IOException
renderStatusHTML in interface ServiceIOExceptionpublic Set<net.i2p.data.Hash> selectPeersInTooManyTunnels()
selectPeersInTooManyTunnels in interface TunnelManagerFacadepublic Map<net.i2p.data.Hash,TunnelPool> getInboundClientPools()
getInboundClientPools in interface TunnelManagerFacadepublic Map<net.i2p.data.Hash,TunnelPool> getOutboundClientPools()
getOutboundClientPools in interface TunnelManagerFacadepublic TunnelPool getInboundExploratoryPool()
getInboundExploratoryPool in interface TunnelManagerFacadepublic TunnelPool getOutboundExploratoryPool()
getOutboundExploratoryPool in interface TunnelManagerFacadepublic TunnelPool getInboundPool(net.i2p.data.Hash client)
getInboundPool in interface TunnelManagerFacadepublic TunnelPool getOutboundPool(net.i2p.data.Hash client)
getOutboundPool in interface TunnelManagerFacadepublic void fail(net.i2p.data.Hash peer)
fail in interface TunnelManagerFacade