Package org.apache.sshd.common.forward
Interface PortForwardingEventListener
-
- All Superinterfaces:
java.util.EventListener,SshdEventListener
public interface PortForwardingEventListener extends SshdEventListener
-
-
Field Summary
Fields Modifier and Type Field Description static PortForwardingEventListenerEMPTY
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default voidestablishedDynamicTunnel(Session session, SshdSocketAddress local, SshdSocketAddress boundAddress, java.lang.Throwable reason)Signals a successful/failed attempt to establish a dynamic port forwardingdefault voidestablishedExplicitTunnel(Session session, SshdSocketAddress local, SshdSocketAddress remote, boolean localForwarding, SshdSocketAddress boundAddress, java.lang.Throwable reason)Signals a successful/failed attempt to establish a local/remote port forwardingdefault voidestablishingDynamicTunnel(Session session, SshdSocketAddress local)Signals the attempt to establish a dynamic port forwardingdefault voidestablishingExplicitTunnel(Session session, SshdSocketAddress local, SshdSocketAddress remote, boolean localForwarding)Signals the attempt to establish a local/remote port forwardingdefault voidtearingDownDynamicTunnel(Session session, SshdSocketAddress address)Signals a request to tear down a dynamic forwardingdefault voidtearingDownExplicitTunnel(Session session, SshdSocketAddress address, boolean localForwarding, SshdSocketAddress remoteAddress)Signals a request to tear down a local/remote port forwardingdefault voidtornDownDynamicTunnel(Session session, SshdSocketAddress address, java.lang.Throwable reason)Signals a successful/failed request to tear down a dynamic port forwardingdefault voidtornDownExplicitTunnel(Session session, SshdSocketAddress address, boolean localForwarding, SshdSocketAddress remoteAddress, java.lang.Throwable reason)Signals a successful/failed request to tear down a local/remote port forwardingstatic <L extends PortForwardingEventListener>
LvalidateListener(L listener)
-
-
-
Field Detail
-
EMPTY
static final PortForwardingEventListener EMPTY
-
-
Method Detail
-
establishingExplicitTunnel
default void establishingExplicitTunnel(Session session, SshdSocketAddress local, SshdSocketAddress remote, boolean localForwarding) throws java.io.IOException
Signals the attempt to establish a local/remote port forwarding- Parameters:
session- TheSessionthrough which the attempt is madelocal- The local address - may benullon the receiver sideremote- The remote address - may benullon the receiver sidelocalForwarding- Local/remote port forwarding indicator- Throws:
java.io.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, java.lang.Throwable reason) throws java.io.IOException
Signals a successful/failed attempt to establish a local/remote port forwarding- Parameters:
session- TheSessionthrough which the attempt was madelocal- The local address - may benullon the receiver sideremote- The remote address - may benullon the receiver sidelocalForwarding- Local/remote port forwarding indicatorboundAddress- The bound address - non-nullif successfulreason- Reason for failure -nullif successful- Throws:
java.io.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 java.io.IOException
Signals a request to tear down a local/remote port forwarding- Parameters:
session- TheSessionthrough which the request is madeaddress- The (bound) address - local/remote according to the forwarding typelocalForwarding- Local/remote port forwarding indicatorremoteAddress- The specified peer address when tunnel was established - may benullfor server-side local tunneling requests- Throws:
java.io.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, java.lang.Throwable reason) throws java.io.IOException
Signals a successful/failed request to tear down a local/remote port forwarding- Parameters:
session- TheSessionthrough which the request is madeaddress- The (bound) address - local/remote according to the forwarding typelocalForwarding- Local/remote port forwarding indicatorremoteAddress- The specified peer address when tunnel was established - may benullfor server-side local tunneling requestsreason- Reason for failure -nullif successful- Throws:
java.io.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 java.io.IOException
Signals the attempt to establish a dynamic port forwarding- Parameters:
session- TheSessionthrough which the attempt is madelocal- The local address- Throws:
java.io.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, java.lang.Throwable reason) throws java.io.IOException
Signals a successful/failed attempt to establish a dynamic port forwarding- Parameters:
session- TheSessionthrough which the attempt is madelocal- The local addressboundAddress- The bound address - non-nullif successfulreason- Reason for failure -nullif successful- Throws:
java.io.IOException- If failed to handle the event - in which case the established tunnel is aborted
-
tearingDownDynamicTunnel
default void tearingDownDynamicTunnel(Session session, SshdSocketAddress address) throws java.io.IOException
Signals a request to tear down a dynamic forwarding- Parameters:
session- TheSessionthrough which the request is madeaddress- The (bound) address - local/remote according to the forwarding type- Throws:
java.io.IOException- If failed to handle the event - in which case the request is aborted
-
tornDownDynamicTunnel
default void tornDownDynamicTunnel(Session session, SshdSocketAddress address, java.lang.Throwable reason) throws java.io.IOException
Signals a successful/failed request to tear down a dynamic port forwarding- Parameters:
session- TheSessionthrough which the request is madeaddress- The (bound) address - local/remote according to the forwarding typereason- Reason for failure -nullif successful- Throws:
java.io.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)
-
-