public class TunnelPoolManager extends Object implements TunnelManagerFacade
| Constructor and Description |
|---|
TunnelPoolManager(RouterContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAlias(Destination dest,
ClientTunnelSettings settings,
Destination existingClient)
Add another destination to the same tunnels.
|
(package private) void |
buildComplete(PooledTunnelCreatorConfig cfg)
queue a recurring test job if appropriate
|
void |
buildTunnels(Destination client,
ClientTunnelSettings settings)
Used only at session startup.
|
boolean |
disableTunnelTesting() |
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?
|
GhostPeerManager |
getGhostPeerManager()
Get the ghost peer manager for tracking unresponsive peers.
|
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
|
TunnelPool |
getInboundPool(Hash client) |
TunnelPoolSettings |
getInboundSettings()
exploratory
|
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
|
TunnelPool |
getOutboundPool(Hash client) |
TunnelPoolSettings |
getOutboundSettings()
exploratory
|
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() |
boolean |
isFirewalled() |
(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 |
removeAlias(Destination dest)
Remove a destination for the same tunnels as another.
|
void |
removeTunnels(Destination dest)
Must be called AFTER deregistration by the client manager.
|
void |
removeTunnels(Hash destination)
This will be called twice, once by the inbound and once by the outbound pool.
|
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)
exploratory
|
void |
setOutboundSettings(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()
Poke the build executor to build more tunnels.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrenderStatusHTMLpublic TunnelPoolManager(RouterContext ctx)
public boolean addAlias(Destination dest, ClientTunnelSettings settings, Destination existingClient)
addAlias in interface TunnelManagerFacadeIllegalArgumentException - if notvoid buildComplete(PooledTunnelCreatorConfig cfg)
public void buildTunnels(Destination client, ClientTunnelSettings settings)
buildTunnels in interface TunnelManagerFacadepublic boolean disableTunnelTesting()
public void fail(Hash peer)
fail in interface TunnelManagerFacadeBuildExecutor getExecutor()
public int getFreeTunnelCount()
TunnelManagerFacadegetFreeTunnelCount in interface TunnelManagerFacadepublic GhostPeerManager getGhostPeerManager()
TunnelManagerFacadegetGhostPeerManager in interface TunnelManagerFacadepublic int getInboundBuildQueueSize()
TunnelManagerFacadegetInboundBuildQueueSize in interface TunnelManagerFacadepublic Map<Hash,TunnelPool> getInboundClientPools()
getInboundClientPools in interface TunnelManagerFacadepublic int getInboundClientTunnelCount()
TunnelManagerFacadegetInboundClientTunnelCount in interface TunnelManagerFacadepublic TunnelPool getInboundExploratoryPool()
getInboundExploratoryPool in interface TunnelManagerFacadepublic TunnelPool getInboundPool(Hash client)
getInboundPool in interface TunnelManagerFacadepublic TunnelPoolSettings getInboundSettings()
getInboundSettings in interface TunnelManagerFacadepublic TunnelPoolSettings getInboundSettings(Hash client)
getInboundSettings in interface TunnelManagerFacadepublic long getLastParticipatingExpiration()
TunnelManagerFacadegetLastParticipatingExpiration in interface TunnelManagerFacadepublic Map<Hash,TunnelPool> getOutboundClientPools()
getOutboundClientPools in interface TunnelManagerFacadepublic int getOutboundClientTunnelCount()
TunnelManagerFacadegetOutboundClientTunnelCount in interface TunnelManagerFacadepublic int getOutboundClientTunnelCount(Hash destination)
getOutboundClientTunnelCount in interface TunnelManagerFacadepublic TunnelPool getOutboundExploratoryPool()
getOutboundExploratoryPool in interface TunnelManagerFacadepublic TunnelPool getOutboundPool(Hash client)
getOutboundPool in interface TunnelManagerFacadepublic TunnelPoolSettings getOutboundSettings()
getOutboundSettings in interface TunnelManagerFacadepublic TunnelPoolSettings getOutboundSettings(Hash client)
getOutboundSettings in interface TunnelManagerFacadepublic int getOutboundTunnelCount()
TunnelManagerFacadegetOutboundTunnelCount in interface TunnelManagerFacadepublic int getParticipatingCount()
TunnelManagerFacadegetParticipatingCount in interface TunnelManagerFacadepublic double getShareRatio()
getShareRatio in interface TunnelManagerFacadepublic boolean isFirewalled()
boolean isShutdown()
public boolean isValidTunnel(Hash client, TunnelInfo tunnel)
TunnelManagerFacadeisValidTunnel in interface TunnelManagerFacadepublic void listPools(List<TunnelPool> out)
listPools in interface TunnelManagerFacadepublic void removeAlias(Destination dest)
removeAlias in interface TunnelManagerFacadepublic void removeTunnels(Destination dest)
removeTunnels in interface TunnelManagerFacadepublic void removeTunnels(Hash destination)
public void restart()
Servicepublic TunnelInfo selectInboundExploratoryTunnel(Hash closestTo)
selectInboundExploratoryTunnel in interface TunnelManagerFacadeclosestTo - non-nullpublic TunnelInfo selectInboundTunnel()
selectInboundTunnel in interface TunnelManagerFacadepublic TunnelInfo selectInboundTunnel(Hash destination)
selectInboundTunnel in interface TunnelManagerFacadedestination - if null, returns inbound exploratory tunnelpublic TunnelInfo selectInboundTunnel(Hash destination, Hash closestTo)
selectInboundTunnel in interface TunnelManagerFacadedestination - if null, returns inbound exploratory tunnelclosestTo - non-nullpublic TunnelInfo selectOutboundExploratoryTunnel(Hash closestTo)
selectOutboundExploratoryTunnel in interface TunnelManagerFacadeclosestTo - non-nullpublic TunnelInfo selectOutboundTunnel()
selectOutboundTunnel in interface TunnelManagerFacadepublic TunnelInfo selectOutboundTunnel(Hash destination)
selectOutboundTunnel in interface TunnelManagerFacadedestination - if null, returns outbound exploratory tunnelpublic TunnelInfo selectOutboundTunnel(Hash destination, Hash closestTo)
selectOutboundTunnel in interface TunnelManagerFacadedestination - if null, returns outbound exploratory tunnelclosestTo - non-nullpublic Set<Hash> selectPeersInTooManyTunnels()
selectPeersInTooManyTunnels in interface TunnelManagerFacadepublic void setInboundSettings(Hash client, TunnelPoolSettings settings)
setInboundSettings in interface TunnelManagerFacadepublic void setInboundSettings(TunnelPoolSettings settings)
setInboundSettings in interface TunnelManagerFacadepublic void setOutboundSettings(Hash client, TunnelPoolSettings settings)
setOutboundSettings in interface TunnelManagerFacadepublic void setOutboundSettings(TunnelPoolSettings settings)
setOutboundSettings in interface TunnelManagerFacadepublic void startup()
Servicevoid tunnelFailed()