net.i2p.router

## Interface TunnelManagerFacade

- All Superinterfaces:
    Service
  All Known Implementing Classes:
    DummyTunnelManagerFacade, TunnelPoolManager

      public interface TunnelManagerFacade
      extends Service

  Manages tunnel creation, maintenance, and selection for encrypted routing. Coordinates exploratory and client-specific tunnels for secure message delivery.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and 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?
    `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()`
    `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)` how many outbound client tunnels in this pool?
    `TunnelPool` | `getOutboundExploratoryPool()` for TunnelRenderer in router console
    `TunnelPool` | `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()`
    `boolean` | `isValidTunnel(Hash client, TunnelInfo tunnel)` Is a tunnel a valid member of the pool?
    `void` | `listPools(List<TunnelPool> out)` for TunnelRenderer in router console
    `void` | `removeAlias(Destination dest)` Remove another destination to the same tunnels.
    `void` | `removeTunnels(Destination client)` Must be called AFTER deregistration by the client manager.
    `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()`
    `void` | `setInboundSettings(Hash client, TunnelPoolSettings settings)`
    `void` | `setInboundSettings(TunnelPoolSettings settings)`
    `void` | `setOutboundSettings(Hash client, TunnelPoolSettings settings)`
    `void` | `setOutboundSettings(TunnelPoolSettings settings)`

    - ### Methods inherited from interface net.i2p.router.Service

      `renderStatusHTML, restart, shutdown, startup`

- - ### Method Detail

    - #### addAlias

          boolean addAlias(Destination dest,
                           ClientTunnelSettings settings,
                           Destination existingClient)

      Add another destination to the same tunnels. Must have same encryption key and a different signing key.
      Returns:
        success
      Throws:
        `IllegalArgumentException` - if not

    - #### buildTunnels

          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.

    - #### fail

          void fail(Hash peer)

    - #### getFreeTunnelCount

          int getFreeTunnelCount()

      how many free inbound tunnels do we have available?

    - #### getGhostPeerManager

          GhostPeerManager getGhostPeerManager()

      Get the ghost peer manager for tracking unresponsive peers.
      Returns:
        the ghost peer manager or null

    - #### getInboundBuildQueueSize

          int getInboundBuildQueueSize()

      count how many inbound tunnel requests we have received but not yet processed

    - #### getInboundClientPools

          Map<Hash,TunnelPool> getInboundClientPools()

      for TunnelRenderer in router console

    - #### getInboundClientTunnelCount

          int getInboundClientTunnelCount()

      how many free inbound client tunnels do we have available?

    - #### getInboundExploratoryPool

          TunnelPool getInboundExploratoryPool()

      for TunnelRenderer in router console

    - #### getInboundPool

          TunnelPool getInboundPool(Hash client)

      Returns:
        pool or null

    - #### getInboundSettings

          TunnelPoolSettings getInboundSettings()

    - #### getInboundSettings

          TunnelPoolSettings getInboundSettings(Hash client)

    - #### getLastParticipatingExpiration

          long getLastParticipatingExpiration()

      When does the last tunnel we are participating in expire?

    - #### getOutboundClientPools

          Map<Hash,TunnelPool> getOutboundClientPools()

      for TunnelRenderer in router console

    - #### getOutboundClientTunnelCount

          int getOutboundClientTunnelCount()

      how many outbound client tunnels do we have available?

    - #### getOutboundClientTunnelCount

          int getOutboundClientTunnelCount(Hash destination)

      how many outbound client tunnels in this pool?

    - #### getOutboundExploratoryPool

          TunnelPool getOutboundExploratoryPool()

      for TunnelRenderer in router console

    - #### getOutboundPool

          TunnelPool getOutboundPool(Hash client)

      Returns:
        pool or null

    - #### getOutboundSettings

          TunnelPoolSettings getOutboundSettings()

    - #### getOutboundSettings

          TunnelPoolSettings getOutboundSettings(Hash client)

    - #### getOutboundTunnelCount

          int getOutboundTunnelCount()

      how many outbound tunnels do we have available?

    - #### getParticipatingCount

          int getParticipatingCount()

      how many tunnels are we participating in?

    - #### getShareRatio

          double getShareRatio()

    - #### isValidTunnel

          boolean isValidTunnel(Hash client,
                                TunnelInfo tunnel)

      Is a tunnel a valid member of the pool?

    - #### listPools

          void listPools(List<TunnelPool> out)

      for TunnelRenderer in router console

    - #### removeAlias

          void removeAlias(Destination dest)

      Remove another destination to the same tunnels.

    - #### removeTunnels

          void removeTunnels(Destination client)

      Must be called AFTER deregistration by the client manager.

    - #### selectInboundExploratoryTunnel

          TunnelInfo selectInboundExploratoryTunnel(Hash closestTo)

      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.
      Parameters:
        `closestTo` - non-null
      Returns:
        null if none

    - #### selectInboundTunnel

          TunnelInfo selectInboundTunnel()

      Pick a random inbound exploratory tunnel
      Returns:
        null if none

    - #### selectInboundTunnel

          TunnelInfo selectInboundTunnel(Hash destination)

      Pick a random inbound tunnel from the given destination's pool
      Parameters:
        `destination` - if null, returns inbound exploratory tunnel
      Returns:
        null if none

    - #### selectInboundTunnel

          TunnelInfo selectInboundTunnel(Hash destination,
                                         Hash closestTo)

      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.
      Parameters:
        `destination` - if null, returns inbound exploratory tunnel
        `closestTo` - non-null
      Returns:
        null if none

    - #### selectOutboundExploratoryTunnel

          TunnelInfo selectOutboundExploratoryTunnel(Hash closestTo)

      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.
      Parameters:
        `closestTo` - non-null
      Returns:
        null if none

    - #### selectOutboundTunnel

          TunnelInfo selectOutboundTunnel()

      Pick a random outbound exploratory tunnel
      Returns:
        null if none

    - #### selectOutboundTunnel

          TunnelInfo selectOutboundTunnel(Hash destination)

      Pick a random outbound tunnel from the given destination's pool
      Parameters:
        `destination` - if null, returns outbound exploratory tunnel
      Returns:
        null if none

    - #### selectOutboundTunnel

          TunnelInfo selectOutboundTunnel(Hash destination,
                                          Hash closestTo)

      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.
      Parameters:
        `destination` - if null, returns outbound exploratory tunnel
        `closestTo` - non-null
      Returns:
        null if none

    - #### selectPeersInTooManyTunnels

          Set<Hash> selectPeersInTooManyTunnels()

      Returns:
        Set of peers that should not be allowed to be in another tunnel

    - #### setInboundSettings

          void setInboundSettings(Hash client,
                                  TunnelPoolSettings settings)

    - #### setInboundSettings

          void setInboundSettings(TunnelPoolSettings settings)

    - #### setOutboundSettings

          void setOutboundSettings(Hash client,
                                   TunnelPoolSettings settings)

    - #### setOutboundSettings

          void setOutboundSettings(TunnelPoolSettings settings)