public class DefaultTcpipForwarder extends AbstractInnerCloseable implements TcpipForwarder, SessionHolder<Session>
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
|
closeFuture, lock, state
log
Constructor and Description |
---|
DefaultTcpipForwarder(ConnectionService service) |
doCloseGracefully, doCloseImmediately
builder, close, isClosed, isClosing, preClose
close, isOpen
public static final String FORWARD_REQUEST_TIMEOUT
public static final long DEFAULT_FORWARD_REQUEST_TIMEOUT
FORWARD_REQUEST_TIMEOUT
if none specifiedpublic DefaultTcpipForwarder(ConnectionService service)
public Session getSession()
getSession
in interface SessionHolder<Session>
public final ConnectionService getConnectionService()
public SshdSocketAddress startLocalPortForwarding(SshdSocketAddress local, SshdSocketAddress remote) throws IOException
TcpipForwarder
startLocalPortForwarding
in interface TcpipForwarder
local
- The local addressremote
- The remote addressSshdSocketAddress
IOException
- If failed to handle requestpublic void stopLocalPortForwarding(SshdSocketAddress local) throws IOException
TcpipForwarder
stopLocalPortForwarding
in interface TcpipForwarder
local
- The local addressIOException
- If failed to handle requestpublic SshdSocketAddress startRemotePortForwarding(SshdSocketAddress remote, SshdSocketAddress local) throws IOException
TcpipForwarder
Start forwarding tcp/ip from the given remote address to the given local address.
The remote host name is the address to bind to on the server:
startRemotePortForwarding
in interface TcpipForwarder
remote
- The remote addresslocal
- The local addressSshdSocketAddress
IOException
- If failed to handle requestpublic void stopRemotePortForwarding(SshdSocketAddress remote) throws IOException
TcpipForwarder
stopRemotePortForwarding
in interface TcpipForwarder
remote
- The remote SshdSocketAddress
IOException
- If failed to handle requestpublic SshdSocketAddress startDynamicPortForwarding(SshdSocketAddress local) throws IOException
startDynamicPortForwarding
in interface TcpipForwarder
IOException
public void stopDynamicPortForwarding(SshdSocketAddress local) throws IOException
stopDynamicPortForwarding
in interface TcpipForwarder
IOException
public SshdSocketAddress getForwardedPort(int remotePort)
getForwardedPort
in interface TcpipForwarder
remotePort
- The remote portSshdSocketAddress
that the remote port is forwarded topublic SshdSocketAddress localPortForwardingRequested(SshdSocketAddress local) throws IOException
TcpipForwarder
localPortForwardingRequested
in interface TcpipForwarder
local
- The request addressSshdSocketAddress
- null
if not allowed to forwardIOException
- If failed to handle requestpublic void localPortForwardingCancelled(SshdSocketAddress local) throws IOException
TcpipForwarder
localPortForwardingCancelled
in interface TcpipForwarder
local
- The local SshdSocketAddress
IOException
- If failed to handle requestprotected Closeable getInnerCloseable()
getInnerCloseable
in class AbstractInnerCloseable
Copyright © 2008–2016 The Apache Software Foundation. All rights reserved.