Class ServerPortForwardingEventListener
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.cli.server.helper.ServerEventListenerHelper
org.apache.sshd.cli.server.helper.ServerPortForwardingEventListener
- All Implemented Interfaces:
EventListener,PortForwardingEventListener,NamedResource,SshdEventListener
public class ServerPortForwardingEventListener
extends ServerEventListenerHelper
implements PortForwardingEventListener
-
Field Summary
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
logFields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTORFields inherited from interface org.apache.sshd.common.forward.PortForwardingEventListener
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidestablishedDynamicTunnel(Session session, SshdSocketAddress local, SshdSocketAddress boundAddress, Throwable reason) Signals a successful/failed attempt to establish a dynamic port forwardingvoidestablishedExplicitTunnel(Session session, SshdSocketAddress local, SshdSocketAddress remote, boolean localForwarding, SshdSocketAddress boundAddress, Throwable reason) Signals a successful/failed attempt to establish a local/remote port forwardingvoidtornDownDynamicTunnel(Session session, SshdSocketAddress address, Throwable reason) Signals a successful/failed request to tear down a dynamic port forwardingvoidtornDownExplicitTunnel(Session session, SshdSocketAddress address, boolean localForwarding, SshdSocketAddress remoteAddress, Throwable reason) Signals a successful/failed request to tear down a local/remote port forwardingMethods inherited from class org.apache.sshd.cli.server.helper.ServerEventListenerHelper
getNameMethods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.sshd.common.forward.PortForwardingEventListener
establishingDynamicTunnel, establishingExplicitTunnel, tearingDownDynamicTunnel, tearingDownExplicitTunnel
-
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:PortForwardingEventListenerSignals a successful/failed attempt to establish a local/remote port forwarding- Specified by:
establishedExplicitTunnelin interfacePortForwardingEventListener- 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:
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:PortForwardingEventListenerSignals a successful/failed request to tear down a local/remote port forwarding- Specified by:
tornDownExplicitTunnelin interfacePortForwardingEventListener- 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:
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:PortForwardingEventListenerSignals a successful/failed attempt to establish a dynamic port forwarding- Specified by:
establishedDynamicTunnelin interfacePortForwardingEventListener- Parameters:
session- TheSessionthrough which the attempt is madelocal- The local addressboundAddress- The bound address - non-nullif successfulreason- Reason for failure -nullif 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:PortForwardingEventListenerSignals a successful/failed request to tear down a dynamic port forwarding- Specified by:
tornDownDynamicTunnelin interfacePortForwardingEventListener- Parameters:
session- TheSessionthrough which the request is madeaddress- The (bound) address - local/remote according to the forwarding typereason- Reason for failure -nullif 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
-