Class AbstractForwardedChannel
- java.lang.Object
-
- net.schmizz.sshj.connection.channel.AbstractChannel
-
- net.schmizz.sshj.connection.channel.forwarded.AbstractForwardedChannel
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,ErrorNotifiable
,SSHPacketHandler
,Channel
,Channel.Forwarded
- Direct Known Subclasses:
RemotePortForwarder.ForwardedTCPIPChannel
,X11Forwarder.X11Channel
public abstract class AbstractForwardedChannel extends AbstractChannel implements Channel.Forwarded
Base class for forwarded channels whose open is initiated by the server.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.schmizz.sshj.connection.channel.AbstractChannel
AbstractChannel.TransportRunnable
-
Nested classes/interfaces inherited from interface net.schmizz.sshj.connection.channel.Channel
Channel.Direct, Channel.Forwarded
-
Nested classes/interfaces inherited from interface net.schmizz.sshj.common.ErrorNotifiable
ErrorNotifiable.Util
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
origIP
protected int
origPort
-
Fields inherited from class net.schmizz.sshj.connection.channel.AbstractChannel
closeEvent, conn, log, loggerFactory, lwin, openEvent, rwin, trans
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractForwardedChannel(Connection conn, java.lang.String type, int recipient, long remoteWinSize, long remoteMaxPacketSize, java.lang.String origIP, int origPort)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
confirm()
ConfirmCHANNEL_OPEN
request.java.lang.String
getOriginatorIP()
int
getOriginatorPort()
void
reject(OpenFailException.Reason reason, java.lang.String message)
Indicate rejection to remote end.-
Methods inherited from class net.schmizz.sshj.connection.channel.AbstractChannel
close, closeAllStreams, eofInputStreams, finishOff, getAutoExpand, getID, getInputStream, getLocalMaxPacketSize, getLocalWinSize, getLoggerFactory, getOutputStream, getRecipient, getRemoteCharset, getRemoteMaxPacketSize, getRemoteWinSize, getType, gotExtendedData, gotUnknown, handle, handleRequest, init, isEOF, isOpen, join, join, newBuffer, notifyError, receiveInto, sendChannelRequest, sendClose, setAutoExpand, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.schmizz.sshj.connection.channel.Channel
close, getAutoExpand, getID, getInputStream, getLocalMaxPacketSize, getLocalWinSize, getLoggerFactory, getOutputStream, getRecipient, getRemoteCharset, getRemoteMaxPacketSize, getRemoteWinSize, getType, isEOF, isOpen, join, join, setAutoExpand
-
Methods inherited from interface net.schmizz.sshj.common.ErrorNotifiable
notifyError
-
Methods inherited from interface net.schmizz.sshj.common.SSHPacketHandler
handle
-
-
-
-
Constructor Detail
-
AbstractForwardedChannel
protected AbstractForwardedChannel(Connection conn, java.lang.String type, int recipient, long remoteWinSize, long remoteMaxPacketSize, java.lang.String origIP, int origPort)
-
-
Method Detail
-
confirm
public void confirm() throws TransportException
Description copied from interface:Channel.Forwarded
ConfirmCHANNEL_OPEN
request.- Specified by:
confirm
in interfaceChannel.Forwarded
- Throws:
TransportException
- error sending confirmation packet
-
reject
public void reject(OpenFailException.Reason reason, java.lang.String message) throws TransportException
Description copied from interface:Channel.Forwarded
Indicate rejection to remote end.- Specified by:
reject
in interfaceChannel.Forwarded
- Parameters:
reason
- indicatereason
for rejection of the requestmessage
- indicate a message for why the request is rejected- Throws:
TransportException
- error sending rejection packet
-
getOriginatorIP
public java.lang.String getOriginatorIP()
- Specified by:
getOriginatorIP
in interfaceChannel.Forwarded
- Returns:
- the IP of where the forwarded connection originates.
-
getOriginatorPort
public int getOriginatorPort()
- Specified by:
getOriginatorPort
in interfaceChannel.Forwarded
- Returns:
- port from which the forwarded connection originates.
-
-