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:
java.util.EventListener,PortForwardingEventListener,NamedResource,SshdEventListener
public class ServerPortForwardingEventListener extends ServerEventListenerHelper implements PortForwardingEventListener
-
-
Field Summary
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR
-
Fields inherited from interface org.apache.sshd.common.forward.PortForwardingEventListener
EMPTY
-
-
Constructor Summary
Constructors Constructor Description ServerPortForwardingEventListener(org.slf4j.Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidestablishedDynamicTunnel(Session session, SshdSocketAddress local, SshdSocketAddress boundAddress, java.lang.Throwable reason)Signals a successful/failed attempt to establish a dynamic port forwardingvoidestablishedExplicitTunnel(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 forwardingvoidtornDownDynamicTunnel(Session session, SshdSocketAddress address, java.lang.Throwable reason)Signals a successful/failed request to tear down a dynamic port forwardingvoidtornDownExplicitTunnel(Session session, SshdSocketAddress address, boolean localForwarding, SshdSocketAddress remoteAddress, java.lang.Throwable reason)Signals a successful/failed request to tear down a local/remote port forwarding-
Methods inherited from class org.apache.sshd.cli.server.helper.ServerEventListenerHelper
getName
-
Methods 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, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.forward.PortForwardingEventListener
establishingDynamicTunnel, establishingExplicitTunnel, tearingDownDynamicTunnel, tearingDownExplicitTunnel
-
-
-
-
Method Detail
-
establishedExplicitTunnel
public void establishedExplicitTunnel(Session session, SshdSocketAddress local, SshdSocketAddress remote, boolean localForwarding, SshdSocketAddress boundAddress, java.lang.Throwable reason) throws java.io.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:
java.io.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, java.lang.Throwable reason) throws java.io.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:
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
-
establishedDynamicTunnel
public void establishedDynamicTunnel(Session session, SshdSocketAddress local, SshdSocketAddress boundAddress, java.lang.Throwable reason) throws java.io.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:
java.io.IOException- If failed to handle the event - in which case the established tunnel is aborted
-
tornDownDynamicTunnel
public void tornDownDynamicTunnel(Session session, SshdSocketAddress address, java.lang.Throwable reason) throws java.io.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:
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
-
-