java.lang.Object
net.i2p.client.TunnelRemovalEvent

public class TunnelRemovalEventextends Object
Event fired when a tunnel is removed from a client tunnel pool. Allows streaming library to gracefully handle connection migration.
  • Field Details

    • _poolName

      private final String _poolName
      The pool the tunnel was in.
    • _tunnelId

      private final TunnelId _tunnelId
      The tunnel being removed.
    • _isInbound

      private final boolean _isInbound
      True for an inbound tunnel.
    • _reason

      private final TunnelRemovalEvent.RemovalReason _reason
      Why the tunnel is going away.
    • _timestamp

      private final long _timestamp
      When the removal happened, in ms.
  • Constructor Details

    • TunnelRemovalEvent

      public TunnelRemovalEvent(String poolName, TunnelId tunnelId, boolean isInbound, TunnelRemovalEvent.RemovalReason reason)
      Create a new tunnel removal event.
      Parameters:
      poolName - the tunnel pool name
      tunnelId - the tunnel ID
      isInbound - true if inbound
      reason - the removal reason
  • Method Details

    • getPoolName

      public String getPoolName()
      Return the tunnel pool name.
      Returns:
      the tunnel pool name
    • getTunnelId

      public TunnelId getTunnelId()
      Return the tunnel ID.
      Returns:
      the tunnel ID
    • isInbound

      public boolean isInbound()
      Return true if the tunnel is inbound.
      Returns:
      true if inbound
    • getReason

      Return the removal reason.
      Returns:
      the removal reason
    • getTimestamp

      public long getTimestamp()
      Return the event timestamp.
      Returns:
      the time in milliseconds since the epoch when the event was created
    • toString

      public String toString()
      Return a string representation.
      Overrides:
      toString in class Object
      Returns:
      a string representation