public abstract class AbstractChannel extends java.lang.Object implements Channel
Channel.Direct, Channel.ForwardedErrorNotifiable.Util| Modifier and Type | Field and Description |
|---|---|
protected Event<ConnectionException> |
closeEvent
Channel close event
|
protected Connection |
conn
Connection layer
|
protected org.slf4j.Logger |
log |
protected LoggerFactory |
loggerFactory
Logger
|
protected Window.Local |
lwin
Local window
|
protected Event<ConnectionException> |
openEvent
Channel open event
|
protected Window.Remote |
rwin
Remote window
|
protected Transport |
trans
Transport layer
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractChannel(Connection conn,
java.lang.String type) |
protected |
AbstractChannel(Connection conn,
java.lang.String type,
java.nio.charset.Charset remoteCharset) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this channel.
|
protected void |
closeAllStreams()
Called when all I/O streams should be closed.
|
protected void |
eofInputStreams()
Called when EOF has been received.
|
protected void |
finishOff() |
boolean |
getAutoExpand() |
int |
getID() |
java.io.InputStream |
getInputStream() |
int |
getLocalMaxPacketSize() |
long |
getLocalWinSize() |
LoggerFactory |
getLoggerFactory()
Get the LoggerFactory associated with the SSH client.
|
java.io.OutputStream |
getOutputStream() |
int |
getRecipient() |
java.nio.charset.Charset |
getRemoteCharset() |
int |
getRemoteMaxPacketSize() |
long |
getRemoteWinSize() |
java.lang.String |
getType() |
protected void |
gotExtendedData(SSHPacket buf) |
protected void |
gotUnknown(Message msg,
SSHPacket buf) |
void |
handle(Message msg,
SSHPacket buf)
Delegate handling of some SSH packet to this object.
|
protected void |
handleRequest(java.lang.String reqType,
SSHPacket buf) |
protected void |
init(int recipient,
long remoteWinSize,
long remoteMaxPacketSize) |
boolean |
isEOF()
Returns whether EOF has been received.
|
boolean |
isOpen() |
void |
join() |
void |
join(long timeout,
java.util.concurrent.TimeUnit unit) |
protected SSHPacket |
newBuffer(Message cmd) |
void |
notifyError(SSHException error)
Notifies this object of an
error. |
protected void |
receiveInto(ChannelInputStream stream,
SSHPacket buf) |
protected Event<ConnectionException> |
sendChannelRequest(java.lang.String reqType,
boolean wantReply,
Buffer.PlainBuffer reqSpecific) |
protected void |
sendClose() |
void |
setAutoExpand(boolean autoExpand)
Set whether local window should automatically expand when data is received, irrespective of whether data has been
read from that stream.
|
java.lang.String |
toString() |
protected final LoggerFactory loggerFactory
protected final org.slf4j.Logger log
protected final Transport trans
protected final Connection conn
protected final Event<ConnectionException> openEvent
protected final Event<ConnectionException> closeEvent
protected final Window.Local lwin
protected Window.Remote rwin
protected AbstractChannel(Connection conn, java.lang.String type)
protected AbstractChannel(Connection conn, java.lang.String type, java.nio.charset.Charset remoteCharset)
protected void init(int recipient,
long remoteWinSize,
long remoteMaxPacketSize)
public boolean getAutoExpand()
getAutoExpand in interface ChannelChannel.setAutoExpand(boolean)public java.io.InputStream getInputStream()
getInputStream in interface ChannelInputStream for this channel.public int getLocalMaxPacketSize()
getLocalMaxPacketSize in interface Channelpublic long getLocalWinSize()
getLocalWinSize in interface Channelpublic java.io.OutputStream getOutputStream()
getOutputStream in interface ChannelOutputStream for this channel.public int getRecipient()
getRecipient in interface Channelpublic java.nio.charset.Charset getRemoteCharset()
getRemoteCharset in interface Channelpublic int getRemoteMaxPacketSize()
getRemoteMaxPacketSize in interface Channelpublic long getRemoteWinSize()
getRemoteWinSize in interface Channelpublic java.lang.String getType()
public void handle(Message msg, SSHPacket buf) throws ConnectionException, TransportException
SSHPacketHandlerhandle in interface SSHPacketHandlermsg - the SSH message identifierbuf - SSHPacket containing rest of the requestConnectionExceptionTransportExceptionpublic boolean isEOF()
Channelpublic LoggerFactory getLoggerFactory()
ChannelgetLoggerFactory in interface Channelprotected void closeAllStreams()
public void notifyError(SSHException error)
ErrorNotifiableerror.notifyError in interface ErrorNotifiablepublic void setAutoExpand(boolean autoExpand)
ChannelInputStream.setAutoExpand in interface ChannelautoExpand - whether local windows should automatically expandpublic void close()
throws ConnectionException,
TransportException
Channelclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface ChannelConnectionExceptionTransportExceptionpublic void join()
throws ConnectionException
join in interface ChannelConnectionExceptionpublic void join(long timeout,
java.util.concurrent.TimeUnit unit)
throws ConnectionException
join in interface ChannelConnectionExceptionprotected void sendClose()
throws TransportException
TransportExceptionpublic boolean isOpen()
protected void finishOff()
protected void gotExtendedData(SSHPacket buf) throws ConnectionException, TransportException
protected void gotUnknown(Message msg, SSHPacket buf) throws ConnectionException, TransportException
protected void handleRequest(java.lang.String reqType,
SSHPacket buf)
throws ConnectionException,
TransportException
protected void receiveInto(ChannelInputStream stream, SSHPacket buf) throws ConnectionException, TransportException
protected Event<ConnectionException> sendChannelRequest(java.lang.String reqType, boolean wantReply, Buffer.PlainBuffer reqSpecific) throws TransportException
TransportExceptionprotected void eofInputStreams()
public java.lang.String toString()
toString in class java.lang.Object