public class DefaultTcpipForwarder extends AbstractInnerCloseable implements TcpipForwarder, SessionHolder<Session>, PortForwardingEventListenerManager
AbstractCloseable.State| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_FORWARD_REQUEST_TIMEOUT
Default value for
FORWARD_REQUEST_TIMEOUT if none specified |
static String |
FORWARD_REQUEST_TIMEOUT
Used to configure the timeout (milliseconds) for receiving a response
for the forwarding request
|
static Set<ClientChannelEvent> |
STATIC_IO_MSG_RECEIVED_EVENTS |
closeFuture, lock, statelogCLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT| Constructor and Description |
|---|
DefaultTcpipForwarder(ConnectionService service) |
doCloseGracefully, doCloseImmediatelyaddCloseFutureListener, builder, close, isClosed, isClosing, removeCloseFutureListenergetSimplifiedLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListenerpublic static final String FORWARD_REQUEST_TIMEOUT
public static final long DEFAULT_FORWARD_REQUEST_TIMEOUT
FORWARD_REQUEST_TIMEOUT if none specifiedpublic static final Set<ClientChannelEvent> STATIC_IO_MSG_RECEIVED_EVENTS
public DefaultTcpipForwarder(ConnectionService service)
public PortForwardingEventListener getPortForwardingEventListenerProxy()
getPortForwardingEventListenerProxy in interface PortForwardingEventListenerManagerpublic void addPortForwardingEventListener(PortForwardingEventListener listener)
PortForwardingEventListenerManageraddPortForwardingEventListener in interface PortForwardingEventListenerManagerlistener - The PortForwardingEventListener to add - never nullpublic void removePortForwardingEventListener(PortForwardingEventListener listener)
PortForwardingEventListenerManagerremovePortForwardingEventListener in interface PortForwardingEventListenerManagerlistener - The PortForwardingEventListener to remove - ignored if nullpublic Collection<PortForwardingEventListenerManager> getRegisteredManagers()
getRegisteredManagers in interface PortForwardingEventListenerManagerHolderpublic boolean addPortForwardingEventListenerManager(PortForwardingEventListenerManager manager)
addPortForwardingEventListenerManager in interface PortForwardingEventListenerManagerHolderpublic boolean removePortForwardingEventListenerManager(PortForwardingEventListenerManager manager)
removePortForwardingEventListenerManager in interface PortForwardingEventListenerManagerHolderpublic Session getSession()
getSession in interface SessionHolder<Session>public final ConnectionService getConnectionService()
protected Collection<PortForwardingEventListener> getDefaultListeners()
public SshdSocketAddress startLocalPortForwarding(SshdSocketAddress local, SshdSocketAddress remote) throws IOException
PortForwardingManagerstartLocalPortForwarding in interface PortForwardingManagerlocal - The local addressremote - The remote addressSshdSocketAddressIOException - If failed to create the requested bindingpublic void stopLocalPortForwarding(SshdSocketAddress local) throws IOException
PortForwardingManagerstopLocalPortForwarding in interface PortForwardingManagerlocal - The local addressIOException - If failed to cancel the requested bindingpublic SshdSocketAddress startRemotePortForwarding(SshdSocketAddress remote, SshdSocketAddress local) throws IOException
PortForwardingManagerStart forwarding tcpip from the given address on the server to the given address on the client.
The remote host name is the address to bind to on the server:startRemotePortForwarding in interface PortForwardingManagerremote - The remote addresslocal - The local addressSshdSocketAddressIOException - If failed to create the requested bindingpublic void stopRemotePortForwarding(SshdSocketAddress remote) throws IOException
PortForwardingManagerstopRemotePortForwarding in interface PortForwardingManagerremote - The remote addressIOException - If failed to cancel the requested bindingprotected void signalTearingDownExplicitTunnel(SshdSocketAddress boundAddress, boolean localForwarding) throws IOException
IOExceptionprotected void signalTearingDownExplicitTunnel(PortForwardingEventListener listener, SshdSocketAddress boundAddress, boolean localForwarding) throws IOException
IOExceptionprotected void signalTornDownExplicitTunnel(SshdSocketAddress boundAddress, boolean localForwarding, Throwable reason) throws IOException
IOExceptionprotected void signalTornDownExplicitTunnel(PortForwardingEventListener listener, SshdSocketAddress boundAddress, boolean localForwarding, Throwable reason) throws IOException
IOExceptionpublic SshdSocketAddress startDynamicPortForwarding(SshdSocketAddress local) throws IOException
PortForwardingManagerstartDynamicPortForwarding in interface PortForwardingManagerlocal - The local addressSshdSocketAddressIOException - If failed to create the requested bindingprotected void signalEstablishedDynamicTunnel(SshdSocketAddress local, SshdSocketAddress boundAddress, Throwable reason) throws IOException
IOExceptionprotected void signalEstablishedDynamicTunnel(PortForwardingEventListener listener, SshdSocketAddress local, SshdSocketAddress boundAddress, Throwable reason) throws IOException
IOExceptionprotected void signalEstablishingDynamicTunnel(SshdSocketAddress local) throws IOException
IOExceptionprotected void signalEstablishingDynamicTunnel(PortForwardingEventListener listener, SshdSocketAddress local) throws IOException
IOExceptionpublic void stopDynamicPortForwarding(SshdSocketAddress local) throws IOException
PortForwardingManagerstopDynamicPortForwarding in interface PortForwardingManagerlocal - The local addressIOException - If failed to cancel the requested bindingprotected void signalTearingDownDynamicTunnel(SshdSocketAddress address) throws IOException
IOExceptionprotected void signalTearingDownDynamicTunnel(PortForwardingEventListener listener, SshdSocketAddress address) throws IOException
IOExceptionprotected void signalTornDownDynamicTunnel(SshdSocketAddress address, Throwable reason) throws IOException
IOExceptionprotected void signalTornDownDynamicTunnel(PortForwardingEventListener listener, SshdSocketAddress address, Throwable reason) throws IOException
IOExceptionpublic SshdSocketAddress getForwardedPort(int remotePort)
getForwardedPort in interface TcpipForwarderremotePort - The remote portSshdSocketAddress that the remote port is forwarded topublic SshdSocketAddress localPortForwardingRequested(SshdSocketAddress local) throws IOException
TcpipForwarderlocalPortForwardingRequested in interface TcpipForwarderlocal - The request addressSshdSocketAddress - null if not allowed to forwardIOException - If failed to handle requestpublic void localPortForwardingCancelled(SshdSocketAddress local) throws IOException
TcpipForwarderlocalPortForwardingCancelled in interface TcpipForwarderlocal - The local SshdSocketAddressIOException - If failed to handle requestprotected void signalEstablishingExplicitTunnel(SshdSocketAddress local, SshdSocketAddress remote, boolean localForwarding) throws IOException
IOExceptionprotected void signalEstablishingExplicitTunnel(PortForwardingEventListener listener, SshdSocketAddress local, SshdSocketAddress remote, boolean localForwarding) throws IOException
IOExceptionprotected void signalEstablishedExplicitTunnel(SshdSocketAddress local, SshdSocketAddress remote, boolean localForwarding, SshdSocketAddress boundAddress, Throwable reason) throws IOException
IOExceptionprotected void signalEstablishedExplicitTunnel(PortForwardingEventListener listener, SshdSocketAddress local, SshdSocketAddress remote, boolean localForwarding, SshdSocketAddress boundAddress, Throwable reason) throws IOException
IOExceptionprotected void invokePortEventListenerSignaller(Invoker<PortForwardingEventListener,Void> invoker) throws Throwable
Throwableprotected void invokePortEventListenerSignallerListeners(Collection<? extends PortForwardingEventListener> listeners, Invoker<PortForwardingEventListener,Void> invoker) throws Throwable
Throwableprotected void invokePortEventListenerSignallerHolders(Collection<? extends PortForwardingEventListenerManager> holders, Invoker<PortForwardingEventListener,Void> invoker) throws Throwable
Throwableprotected Closeable getInnerCloseable()
getInnerCloseable in class AbstractInnerCloseableprotected void preClose()
AbstractCloseablepreClose in class AbstractCloseableCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.