Package net.i2p.router.dummy
Class DummyTunnelManagerFacade
- java.lang.Object
-
- net.i2p.router.dummy.DummyTunnelManagerFacade
-
- All Implemented Interfaces:
Service
,TunnelManagerFacade
public class DummyTunnelManagerFacade extends Object implements TunnelManagerFacade
Build and maintain tunnels throughout the network.
-
-
Constructor Summary
Constructors Constructor Description DummyTunnelManagerFacade()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
addAlias(Destination dest, ClientTunnelSettings settings, Destination existingClient)
Add another destination to the same tunnels.void
buildTunnels(Destination client, ClientTunnelSettings settings)
the client connected (or updated their settings), so make sure we have the tunnels for them, and whenever necessary, ask them to authorize leases.void
fail(Hash peer)
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 processedMap<Hash,TunnelPool>
getInboundClientPools()
for TunnelRenderer in router consoleint
getInboundClientTunnelCount()
how many free inbound client tunnels do we have available?TunnelPool
getInboundExploratoryPool()
for TunnelRenderer in router consoleTunnelPool
getInboundPool(Hash client)
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 consoleint
getOutboundClientTunnelCount()
how many outbound client tunnels do we have available?int
getOutboundClientTunnelCount(Hash destination)
how many outbound client tunnels in this pool?TunnelPool
getOutboundExploratoryPool()
for TunnelRenderer in router consoleTunnelPool
getOutboundPool(Hash client)
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)
Deprecated.unusedboolean
isValidTunnel(Hash client, TunnelInfo tunnel)
Is a tunnel a valid member of the pool?void
listPools(List<TunnelPool> out)
for TunnelRenderer in router consolevoid
removeAlias(Destination dest)
Remove another destination to the same tunnels.void
removeTunnels(Destination client)
Must be called AFTER deregistration by the client manager.void
renderStatusHTML(Writer out)
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 tunnelTunnelInfo
selectInboundTunnel(Hash destination)
Pick a random inbound tunnel from the given destination's poolTunnelInfo
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 tunnelTunnelInfo
selectOutboundTunnel(Hash destination)
Pick a random outbound tunnel from the given destination's poolTunnelInfo
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()
void
setInboundSettings(Hash client, TunnelPoolSettings settings)
void
setInboundSettings(TunnelPoolSettings settings)
void
setOutboundSettings(Hash client, TunnelPoolSettings settings)
void
setOutboundSettings(TunnelPoolSettings settings)
void
shutdown()
Instruct the service that the router is shutting down and that it should do whatever is necessary to go down gracefully.void
startup()
Instruct the service that it should start normal operation.
-
-
-
Method Detail
-
getTunnelInfo
@Deprecated public TunnelInfo getTunnelInfo(TunnelId id)
Deprecated.unusedDescription copied from interface:TunnelManagerFacade
Retrieve the information related to a particular tunnel- Specified by:
getTunnelInfo
in interfaceTunnelManagerFacade
- Parameters:
id
- the tunnelId as seen at the gateway
-
selectInboundTunnel
public TunnelInfo selectInboundTunnel()
Description copied from interface:TunnelManagerFacade
Pick a random inbound exploratory tunnel- Specified by:
selectInboundTunnel
in interfaceTunnelManagerFacade
- Returns:
- null if none
-
selectInboundTunnel
public TunnelInfo selectInboundTunnel(Hash destination)
Description copied from interface:TunnelManagerFacade
Pick a random inbound tunnel from the given destination's pool- Specified by:
selectInboundTunnel
in interfaceTunnelManagerFacade
- Parameters:
destination
- if null, returns inbound exploratory tunnel- Returns:
- null if none
-
selectOutboundTunnel
public TunnelInfo selectOutboundTunnel()
Description copied from interface:TunnelManagerFacade
Pick a random outbound exploratory tunnel- Specified by:
selectOutboundTunnel
in interfaceTunnelManagerFacade
- Returns:
- null if none
-
selectOutboundTunnel
public TunnelInfo selectOutboundTunnel(Hash destination)
Description copied from interface:TunnelManagerFacade
Pick a random outbound tunnel from the given destination's pool- Specified by:
selectOutboundTunnel
in interfaceTunnelManagerFacade
- Parameters:
destination
- if null, returns outbound exploratory tunnel- Returns:
- null if none
-
selectInboundExploratoryTunnel
public TunnelInfo selectInboundExploratoryTunnel(Hash closestTo)
Description copied from interface:TunnelManagerFacade
Pick the inbound exploratory tunnel with the gateway closest to the given hash. By using this instead of the random selectTunnel(), we force some locality in OBEP-IBGW connections to minimize those connections network-wide.- Specified by:
selectInboundExploratoryTunnel
in interfaceTunnelManagerFacade
- Parameters:
closestTo
- non-null- Returns:
- null if none
-
selectInboundTunnel
public TunnelInfo selectInboundTunnel(Hash destination, Hash closestTo)
Description copied from interface:TunnelManagerFacade
Pick the inbound tunnel with the gateway closest to the given hash from the given destination's pool. By using this instead of the random selectTunnel(), we force some locality in OBEP-IBGW connections to minimize those connections network-wide.- Specified by:
selectInboundTunnel
in interfaceTunnelManagerFacade
- Parameters:
destination
- if null, returns inbound exploratory tunnelclosestTo
- non-null- Returns:
- null if none
-
selectOutboundExploratoryTunnel
public TunnelInfo selectOutboundExploratoryTunnel(Hash closestTo)
Description copied from interface:TunnelManagerFacade
Pick the outbound exploratory tunnel with the endpoint closest to the given hash. By using this instead of the random selectTunnel(), we force some locality in OBEP-IBGW connections to minimize those connections network-wide.- Specified by:
selectOutboundExploratoryTunnel
in interfaceTunnelManagerFacade
- Parameters:
closestTo
- non-null- Returns:
- null if none
-
selectOutboundTunnel
public TunnelInfo selectOutboundTunnel(Hash destination, Hash closestTo)
Description copied from interface:TunnelManagerFacade
Pick the outbound tunnel with the endpoint closest to the given hash from the given destination's pool. By using this instead of the random selectTunnel(), we force some locality in OBEP-IBGW connections to minimize those connections network-wide.- Specified by:
selectOutboundTunnel
in interfaceTunnelManagerFacade
- Parameters:
destination
- if null, returns outbound exploratory tunnelclosestTo
- non-null- Returns:
- null if none
-
isValidTunnel
public boolean isValidTunnel(Hash client, TunnelInfo tunnel)
Description copied from interface:TunnelManagerFacade
Is a tunnel a valid member of the pool?- Specified by:
isValidTunnel
in interfaceTunnelManagerFacade
-
getParticipatingCount
public int getParticipatingCount()
Description copied from interface:TunnelManagerFacade
how many tunnels are we participating in?- Specified by:
getParticipatingCount
in interfaceTunnelManagerFacade
-
getFreeTunnelCount
public int getFreeTunnelCount()
Description copied from interface:TunnelManagerFacade
how many free inbound tunnels do we have available?- Specified by:
getFreeTunnelCount
in interfaceTunnelManagerFacade
-
getOutboundTunnelCount
public int getOutboundTunnelCount()
Description copied from interface:TunnelManagerFacade
how many outbound tunnels do we have available?- Specified by:
getOutboundTunnelCount
in interfaceTunnelManagerFacade
-
getInboundClientTunnelCount
public int getInboundClientTunnelCount()
Description copied from interface:TunnelManagerFacade
how many free inbound client tunnels do we have available?- Specified by:
getInboundClientTunnelCount
in interfaceTunnelManagerFacade
-
getShareRatio
public double getShareRatio()
- Specified by:
getShareRatio
in interfaceTunnelManagerFacade
-
getOutboundClientTunnelCount
public int getOutboundClientTunnelCount()
Description copied from interface:TunnelManagerFacade
how many outbound client tunnels do we have available?- Specified by:
getOutboundClientTunnelCount
in interfaceTunnelManagerFacade
-
getOutboundClientTunnelCount
public int getOutboundClientTunnelCount(Hash destination)
Description copied from interface:TunnelManagerFacade
how many outbound client tunnels in this pool?- Specified by:
getOutboundClientTunnelCount
in interfaceTunnelManagerFacade
-
getLastParticipatingExpiration
public long getLastParticipatingExpiration()
Description copied from interface:TunnelManagerFacade
When does the last tunnel we are participating in expire?- Specified by:
getLastParticipatingExpiration
in interfaceTunnelManagerFacade
-
buildTunnels
public void buildTunnels(Destination client, ClientTunnelSettings settings)
Description copied from interface:TunnelManagerFacade
the client connected (or updated their settings), so make sure we have the tunnels for them, and whenever necessary, ask them to authorize leases.- Specified by:
buildTunnels
in interfaceTunnelManagerFacade
-
removeTunnels
public void removeTunnels(Destination client)
Description copied from interface:TunnelManagerFacade
Must be called AFTER deregistration by the client manager.- Specified by:
removeTunnels
in interfaceTunnelManagerFacade
-
addAlias
public boolean addAlias(Destination dest, ClientTunnelSettings settings, Destination existingClient)
Description copied from interface:TunnelManagerFacade
Add another destination to the same tunnels. Must have same encryption key and a different signing key.- Specified by:
addAlias
in interfaceTunnelManagerFacade
- Returns:
- success
-
removeAlias
public void removeAlias(Destination dest)
Description copied from interface:TunnelManagerFacade
Remove another destination to the same tunnels.- Specified by:
removeAlias
in interfaceTunnelManagerFacade
-
getInboundSettings
public TunnelPoolSettings getInboundSettings()
- Specified by:
getInboundSettings
in interfaceTunnelManagerFacade
-
getOutboundSettings
public TunnelPoolSettings getOutboundSettings()
- Specified by:
getOutboundSettings
in interfaceTunnelManagerFacade
-
getInboundSettings
public TunnelPoolSettings getInboundSettings(Hash client)
- Specified by:
getInboundSettings
in interfaceTunnelManagerFacade
-
getOutboundSettings
public TunnelPoolSettings getOutboundSettings(Hash client)
- Specified by:
getOutboundSettings
in interfaceTunnelManagerFacade
-
setInboundSettings
public void setInboundSettings(TunnelPoolSettings settings)
- Specified by:
setInboundSettings
in interfaceTunnelManagerFacade
-
setOutboundSettings
public void setOutboundSettings(TunnelPoolSettings settings)
- Specified by:
setOutboundSettings
in interfaceTunnelManagerFacade
-
setInboundSettings
public void setInboundSettings(Hash client, TunnelPoolSettings settings)
- Specified by:
setInboundSettings
in interfaceTunnelManagerFacade
-
setOutboundSettings
public void setOutboundSettings(Hash client, TunnelPoolSettings settings)
- Specified by:
setOutboundSettings
in interfaceTunnelManagerFacade
-
getInboundBuildQueueSize
public int getInboundBuildQueueSize()
Description copied from interface:TunnelManagerFacade
count how many inbound tunnel requests we have received but not yet processed- Specified by:
getInboundBuildQueueSize
in interfaceTunnelManagerFacade
-
selectPeersInTooManyTunnels
public Set<Hash> selectPeersInTooManyTunnels()
- Specified by:
selectPeersInTooManyTunnels
in interfaceTunnelManagerFacade
- Returns:
- Set of peers that should not be allowed to be in another tunnel
-
renderStatusHTML
public void renderStatusHTML(Writer out) throws IOException
- Specified by:
renderStatusHTML
in interfaceService
- Throws:
IOException
-
restart
public void restart()
Description copied from interface:Service
Perform a soft restart.
-
shutdown
public void shutdown()
Description copied from interface:Service
Instruct the service that the router is shutting down and that it should do whatever is necessary to go down gracefully. It should not depend on other components at this point. This call DOES block.
-
startup
public void startup()
Description copied from interface:Service
Instruct the service that it should start normal operation. This call DOES block until the service is ready.
-
listPools
public void listPools(List<TunnelPool> out)
Description copied from interface:TunnelManagerFacade
for TunnelRenderer in router console- Specified by:
listPools
in interfaceTunnelManagerFacade
-
getInboundClientPools
public Map<Hash,TunnelPool> getInboundClientPools()
Description copied from interface:TunnelManagerFacade
for TunnelRenderer in router console- Specified by:
getInboundClientPools
in interfaceTunnelManagerFacade
-
getOutboundClientPools
public Map<Hash,TunnelPool> getOutboundClientPools()
Description copied from interface:TunnelManagerFacade
for TunnelRenderer in router console- Specified by:
getOutboundClientPools
in interfaceTunnelManagerFacade
-
getInboundExploratoryPool
public TunnelPool getInboundExploratoryPool()
Description copied from interface:TunnelManagerFacade
for TunnelRenderer in router console- Specified by:
getInboundExploratoryPool
in interfaceTunnelManagerFacade
-
getOutboundExploratoryPool
public TunnelPool getOutboundExploratoryPool()
Description copied from interface:TunnelManagerFacade
for TunnelRenderer in router console- Specified by:
getOutboundExploratoryPool
in interfaceTunnelManagerFacade
-
fail
public void fail(Hash peer)
- Specified by:
fail
in interfaceTunnelManagerFacade
-
getInboundPool
public TunnelPool getInboundPool(Hash client)
- Specified by:
getInboundPool
in interfaceTunnelManagerFacade
- Returns:
- pool or null
-
getOutboundPool
public TunnelPool getOutboundPool(Hash client)
- Specified by:
getOutboundPool
in interfaceTunnelManagerFacade
- Returns:
- pool or null
-
-