public class RemotePortForwarder extends AbstractForwardedChannelOpener
| Modifier and Type | Class and Description |
|---|---|
static class |
RemotePortForwarder.Forward
Represents a particular forwarding.
|
static class |
RemotePortForwarder.ForwardedTCPIPChannel
A
forwarded-tcpip channel. |
| Modifier and Type | Field and Description |
|---|---|
protected Map<RemotePortForwarder.Forward,ConnectListener> |
listeners |
protected static String |
PF_CANCEL |
protected static String |
PF_REQ |
chanType, conn, log| Constructor and Description |
|---|
RemotePortForwarder(Connection conn) |
| Modifier and Type | Method and Description |
|---|---|
RemotePortForwarder.Forward |
bind(RemotePortForwarder.Forward forward,
ConnectListener listener)
Request forwarding from the remote host on the specified
RemotePortForwarder.Forward. |
void |
cancel(RemotePortForwarder.Forward forward)
Request cancellation of some forwarding.
|
Set<RemotePortForwarder.Forward> |
getActiveForwards() |
void |
handleOpen(SSHPacket buf)
Internal API.
|
protected SSHPacket |
req(String reqName,
RemotePortForwarder.Forward forward) |
callListener, getChannelTypeprotected static final String PF_REQ
protected static final String PF_CANCEL
protected final Map<RemotePortForwarder.Forward,ConnectListener> listeners
public RemotePortForwarder(Connection conn)
public RemotePortForwarder.Forward bind(RemotePortForwarder.Forward forward, ConnectListener listener) throws ConnectionException, TransportException
RemotePortForwarder.Forward. Forwarded connections will be handled
by supplied listener.
If forward specifies as 0, the returned forward will have the correct port number as informed by remote
host.forward - the RemotePortForwarder.Forward to put in place on remote hostlistener - the listener which will next forwarded connectionRemotePortForwarder.Forward which was put into place on the remote hostConnectionException - if there is an error requesting the forwardingTransportExceptionpublic void cancel(RemotePortForwarder.Forward forward) throws ConnectionException, TransportException
forward - the forward which is being cancelledConnectionException - if there is an error with the cancellation requestTransportExceptionprotected SSHPacket req(String reqName, RemotePortForwarder.Forward forward) throws ConnectionException, TransportException
public Set<RemotePortForwarder.Forward> getActiveForwards()
public void handleOpen(SSHPacket buf) throws ConnectionException, TransportException
RemotePortForwarder.ForwardedTCPIPChannel from the CHANNEL_OPEN request and calls associated
ConnectListener for that forward in a separate thread.buf - SSHPacket containg the request except for the message identifier and channel type fieldConnectionExceptionTransportExceptionCopyright © 2009–2014. All rights reserved.