|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.i2p.router.tunnel.pool.TunnelPoolManager
public class TunnelPoolManager
Manage all the exploratory and client tunnel pools. Run the tunnel builder and handler threads.
| Constructor Summary | |
|---|---|
TunnelPoolManager(RouterContext ctx)
|
|
| Method Summary | |
|---|---|
(package private) void |
buildComplete(PooledTunnelCreatorConfig cfg)
queue a recurring test job if appropriate |
void |
buildTunnels(Destination client,
ClientTunnelSettings settings)
Used only at session startup. |
void |
fail(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<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 |
TunnelPoolSettings |
getInboundSettings()
|
TunnelPoolSettings |
getInboundSettings(Hash client)
|
long |
getLastParticipatingExpiration()
When does the last tunnel we are participating in expire? |
Map<Hash,TunnelPool> |
getOutboundClientPools()
for TunnelRenderer in router console |
int |
getOutboundClientTunnelCount()
how many outbound client tunnels do we have available? |
int |
getOutboundClientTunnelCount(Hash destination)
Use to verify a tunnel pool is alive |
TunnelPool |
getOutboundExploratoryPool()
For TunnelRenderer in router console |
TunnelPoolSettings |
getOutboundSettings()
|
TunnelPoolSettings |
getOutboundSettings(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(TunnelId id)
Retrieve the information related to a particular tunnel |
(package private) boolean |
isShutdown()
|
boolean |
isValidTunnel(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 |
removeTunnels(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(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(Hash destination)
Pick a random inbound tunnel from the given destination's pool. |
TunnelInfo |
selectInboundTunnel(Hash destination,
Hash closestTo)
Pick the inbound tunnel with the gateway closest to the given hash from the given destination's pool. |
TunnelInfo |
selectOutboundExploratoryTunnel(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(Hash destination)
Pick a random outbound tunnel from the given destination's pool. |
TunnelInfo |
selectOutboundTunnel(Hash destination,
Hash closestTo)
Pick the outbound tunnel with the endpoint closest to the given hash from the given destination's pool. |
Set<Hash> |
selectPeersInTooManyTunnels()
For reliability reasons, don't allow a peer in more than x% of client and exploratory tunnels. |
void |
setInboundSettings(Hash client,
TunnelPoolSettings settings)
|
void |
setInboundSettings(TunnelPoolSettings settings)
|
void |
setOutboundSettings(Hash client,
TunnelPoolSettings settings)
|
void |
setOutboundSettings(TunnelPoolSettings settings)
|
void |
shutdown()
Cannot be restarted |
void |
startup()
Instruct the service that it should start normal operation. |
(package private) void |
tunnelFailed()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TunnelPoolManager(RouterContext ctx)
| Method Detail |
|---|
public TunnelInfo selectInboundTunnel()
selectInboundTunnel in interface TunnelManagerFacadepublic TunnelInfo selectInboundTunnel(Hash destination)
selectInboundTunnel in interface TunnelManagerFacadedestination - if null, returns inbound exploratory tunnel
public TunnelInfo selectOutboundTunnel()
selectOutboundTunnel in interface TunnelManagerFacadepublic TunnelInfo selectOutboundTunnel(Hash destination)
selectOutboundTunnel in interface TunnelManagerFacadedestination - if null, returns outbound exploratory tunnel
public TunnelInfo selectInboundExploratoryTunnel(Hash closestTo)
selectInboundExploratoryTunnel in interface TunnelManagerFacadeclosestTo - non-null
public TunnelInfo selectInboundTunnel(Hash destination,
Hash closestTo)
selectInboundTunnel in interface TunnelManagerFacadedestination - if null, returns inbound exploratory tunnelclosestTo - non-null
public TunnelInfo selectOutboundExploratoryTunnel(Hash closestTo)
selectOutboundExploratoryTunnel in interface TunnelManagerFacadeclosestTo - non-null
public TunnelInfo selectOutboundTunnel(Hash destination,
Hash closestTo)
selectOutboundTunnel in interface TunnelManagerFacadedestination - if null, returns outbound exploratory tunnelclosestTo - non-null
public TunnelInfo getTunnelInfo(TunnelId id)
TunnelManagerFacade
getTunnelInfo in interface TunnelManagerFacadeid - the tunnelId as seen at the gatewaypublic int getFreeTunnelCount()
TunnelManagerFacade
getFreeTunnelCount in interface TunnelManagerFacadepublic int getOutboundTunnelCount()
TunnelManagerFacade
getOutboundTunnelCount in interface TunnelManagerFacadepublic int getInboundClientTunnelCount()
TunnelManagerFacade
getInboundClientTunnelCount in interface TunnelManagerFacadepublic int getOutboundClientTunnelCount()
TunnelManagerFacade
getOutboundClientTunnelCount in interface TunnelManagerFacadepublic int getOutboundClientTunnelCount(Hash destination)
getOutboundClientTunnelCount in interface TunnelManagerFacadepublic int getParticipatingCount()
TunnelManagerFacade
getParticipatingCount in interface TunnelManagerFacadepublic long getLastParticipatingExpiration()
TunnelManagerFacade
getLastParticipatingExpiration in interface TunnelManagerFacadepublic double getShareRatio()
getShareRatio in interface TunnelManagerFacade
public boolean isValidTunnel(Hash client,
TunnelInfo tunnel)
TunnelManagerFacade
isValidTunnel 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(Hash client)
getInboundSettings in interface TunnelManagerFacadepublic TunnelPoolSettings getOutboundSettings(Hash client)
getOutboundSettings in interface TunnelManagerFacade
public void setInboundSettings(Hash client,
TunnelPoolSettings settings)
setInboundSettings in interface TunnelManagerFacade
public void setOutboundSettings(Hash client,
TunnelPoolSettings settings)
setOutboundSettings in interface TunnelManagerFacadepublic void restart()
Service
restart in interface Service
public void buildTunnels(Destination client,
ClientTunnelSettings settings)
buildTunnels in interface TunnelManagerFacadepublic void removeTunnels(Hash destination)
void buildComplete(PooledTunnelCreatorConfig cfg)
public void startup()
Service
startup in interface Servicepublic void shutdown()
shutdown in interface Servicepublic void listPools(List<TunnelPool> out)
listPools in interface TunnelManagerFacadevoid tunnelFailed()
BuildExecutor getExecutor()
boolean isShutdown()
public int getInboundBuildQueueSize()
TunnelManagerFacade
getInboundBuildQueueSize in interface TunnelManagerFacade
public void renderStatusHTML(Writer out)
throws IOException
renderStatusHTML in interface ServiceIOExceptionpublic Set<Hash> selectPeersInTooManyTunnels()
selectPeersInTooManyTunnels in interface TunnelManagerFacadepublic Map<Hash,TunnelPool> getInboundClientPools()
getInboundClientPools in interface TunnelManagerFacadepublic Map<Hash,TunnelPool> getOutboundClientPools()
getOutboundClientPools in interface TunnelManagerFacadepublic TunnelPool getInboundExploratoryPool()
getInboundExploratoryPool in interface TunnelManagerFacadepublic TunnelPool getOutboundExploratoryPool()
getOutboundExploratoryPool in interface TunnelManagerFacadepublic void fail(Hash peer)
fail in interface TunnelManagerFacade
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||