Interface PortForwardingEventListener

All Superinterfaces:
EventListener, SshdEventListener

public interface PortForwardingEventListener extends SshdEventListener
Author:
Apache MINA SSHD Project
  • Field Details

  • Method Details

    • establishingExplicitTunnel

      default void establishingExplicitTunnel(Session session, SshdSocketAddress local, SshdSocketAddress remote, boolean localForwarding) throws IOException
      Signals the attempt to establish a local/remote port forwarding
      Parameters:
      session - The Session through which the attempt is made
      local - The local address - may be null on the receiver side
      remote - The remote address - may be null on the receiver side
      localForwarding - Local/remote port forwarding indicator
      Throws:
      IOException - If failed to handle the event - in which case the attempt is aborted and the exception re-thrown to the caller
    • establishedExplicitTunnel

      default void establishedExplicitTunnel(Session session, SshdSocketAddress local, SshdSocketAddress remote, boolean localForwarding, SshdSocketAddress boundAddress, Throwable reason) throws IOException
      Signals a successful/failed attempt to establish a local/remote port forwarding
      Parameters:
      session - The Session through which the attempt was made
      local - The local address - may be null on the receiver side
      remote - The remote address - may be null on the receiver side
      localForwarding - Local/remote port forwarding indicator
      boundAddress - The bound address - non-null if successful
      reason - Reason for failure - null if successful
      Throws:
      IOException - If failed to handle the event - in which case the established tunnel is aborted
    • tearingDownExplicitTunnel

      default void tearingDownExplicitTunnel(Session session, SshdSocketAddress address, boolean localForwarding, SshdSocketAddress remoteAddress) throws IOException
      Signals a request to tear down a local/remote port forwarding
      Parameters:
      session - The Session through which the request is made
      address - The (bound) address - local/remote according to the forwarding type
      localForwarding - Local/remote port forwarding indicator
      remoteAddress - The specified peer address when tunnel was established - may be null for server-side local tunneling requests
      Throws:
      IOException - If failed to handle the event - in which case the request is aborted
    • tornDownExplicitTunnel

      default void tornDownExplicitTunnel(Session session, SshdSocketAddress address, boolean localForwarding, SshdSocketAddress remoteAddress, Throwable reason) throws IOException
      Signals a successful/failed request to tear down a local/remote port forwarding
      Parameters:
      session - The Session through which the request is made
      address - The (bound) address - local/remote according to the forwarding type
      localForwarding - Local/remote port forwarding indicator
      remoteAddress - The specified peer address when tunnel was established - may be null for server-side local tunneling requests
      reason - Reason for failure - null if successful
      Throws:
      IOException - If failed to handle the event - Note: the exception is propagated, but the port forwarding may have been torn down - no rollback
    • establishingDynamicTunnel

      default void establishingDynamicTunnel(Session session, SshdSocketAddress local) throws IOException
      Signals the attempt to establish a dynamic port forwarding
      Parameters:
      session - The Session through which the attempt is made
      local - The local address
      Throws:
      IOException - If failed to handle the event - in which case the attempt is aborted and the exception re-thrown to the caller
    • establishedDynamicTunnel

      default void establishedDynamicTunnel(Session session, SshdSocketAddress local, SshdSocketAddress boundAddress, Throwable reason) throws IOException
      Signals a successful/failed attempt to establish a dynamic port forwarding
      Parameters:
      session - The Session through which the attempt is made
      local - The local address
      boundAddress - The bound address - non-null if successful
      reason - Reason for failure - null if successful
      Throws:
      IOException - If failed to handle the event - in which case the established tunnel is aborted
    • tearingDownDynamicTunnel

      default void tearingDownDynamicTunnel(Session session, SshdSocketAddress address) throws IOException
      Signals a request to tear down a dynamic forwarding
      Parameters:
      session - The Session through which the request is made
      address - The (bound) address - local/remote according to the forwarding type
      Throws:
      IOException - If failed to handle the event - in which case the request is aborted
    • tornDownDynamicTunnel

      default void tornDownDynamicTunnel(Session session, SshdSocketAddress address, Throwable reason) throws IOException
      Signals a successful/failed request to tear down a dynamic port forwarding
      Parameters:
      session - The Session through which the request is made
      address - The (bound) address - local/remote according to the forwarding type
      reason - Reason for failure - null if successful
      Throws:
      IOException - If failed to handle the event - Note: the exception is propagated, but the port forwarding may have been torn down - no rollback
    • validateListener

      static <L extends PortForwardingEventListener> L validateListener(L listener)