public abstract class AbstractChannel extends java.lang.Object implements Channel
Channel.Direct, Channel.Forwarded
ErrorNotifiable.Util
Modifier and Type | Field and Description |
---|---|
protected Event<ConnectionException> |
closeEvent
Channel close event
|
protected Connection |
conn
Connection layer
|
protected org.slf4j.Logger |
log
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) |
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() |
java.io.OutputStream |
getOutputStream() |
int |
getRecipient() |
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 |
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 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 void init(int recipient, long remoteWinSize, long remoteMaxPacketSize)
public boolean getAutoExpand()
getAutoExpand
in interface Channel
Channel.setAutoExpand(boolean)
public java.io.InputStream getInputStream()
getInputStream
in interface Channel
InputStream
for this channel.public int getLocalMaxPacketSize()
getLocalMaxPacketSize
in interface Channel
public long getLocalWinSize()
getLocalWinSize
in interface Channel
public java.io.OutputStream getOutputStream()
getOutputStream
in interface Channel
OutputStream
for this channel.public int getRecipient()
getRecipient
in interface Channel
public int getRemoteMaxPacketSize()
getRemoteMaxPacketSize
in interface Channel
public long getRemoteWinSize()
getRemoteWinSize
in interface Channel
public java.lang.String getType()
public void handle(Message msg, SSHPacket buf) throws ConnectionException, TransportException
SSHPacketHandler
handle
in interface SSHPacketHandler
msg
- the SSH message identifier
buf
- SSHPacket
containing rest of the requestConnectionException
TransportException
protected void closeAllStreams()
public void notifyError(SSHException error)
ErrorNotifiable
error
.notifyError
in interface ErrorNotifiable
public void setAutoExpand(boolean autoExpand)
Channel
InputStream
.setAutoExpand
in interface Channel
autoExpand
- whether local windows should automatically expandpublic void close() throws ConnectionException, TransportException
Channel
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface Channel
ConnectionException
TransportException
public void join() throws ConnectionException
join
in interface Channel
ConnectionException
public void join(long timeout, java.util.concurrent.TimeUnit unit) throws ConnectionException
join
in interface Channel
ConnectionException
protected void sendClose() throws TransportException
TransportException
public 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
TransportException
protected void eofInputStreams()
public java.lang.String toString()
toString
in class java.lang.Object