Class ServerPortForwardingEventListener

All Implemented Interfaces:
EventListener, PortForwardingEventListener, NamedResource, SshdEventListener

public class ServerPortForwardingEventListener extends ServerEventListenerHelper implements PortForwardingEventListener
  • Constructor Details

    • ServerPortForwardingEventListener

      public ServerPortForwardingEventListener(org.slf4j.Logger logger)
  • Method Details

    • establishedExplicitTunnel

      public void establishedExplicitTunnel(Session session, SshdSocketAddress local, SshdSocketAddress remote, boolean localForwarding, SshdSocketAddress boundAddress, Throwable reason) throws IOException
      Description copied from interface: PortForwardingEventListener
      Signals a successful/failed attempt to establish a local/remote port forwarding
      Specified by:
      establishedExplicitTunnel in interface PortForwardingEventListener
      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
    • tornDownExplicitTunnel

      public void tornDownExplicitTunnel(Session session, SshdSocketAddress address, boolean localForwarding, SshdSocketAddress remoteAddress, Throwable reason) throws IOException
      Description copied from interface: PortForwardingEventListener
      Signals a successful/failed request to tear down a local/remote port forwarding
      Specified by:
      tornDownExplicitTunnel in interface PortForwardingEventListener
      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
    • establishedDynamicTunnel

      public void establishedDynamicTunnel(Session session, SshdSocketAddress local, SshdSocketAddress boundAddress, Throwable reason) throws IOException
      Description copied from interface: PortForwardingEventListener
      Signals a successful/failed attempt to establish a dynamic port forwarding
      Specified by:
      establishedDynamicTunnel in interface PortForwardingEventListener
      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
    • tornDownDynamicTunnel

      public void tornDownDynamicTunnel(Session session, SshdSocketAddress address, Throwable reason) throws IOException
      Description copied from interface: PortForwardingEventListener
      Signals a successful/failed request to tear down a dynamic port forwarding
      Specified by:
      tornDownDynamicTunnel in interface PortForwardingEventListener
      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