public abstract class AbstractChannel extends 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
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,
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() |
InputStream |
getInputStream() |
int |
getLocalMaxPacketSize() |
long |
getLocalWinSize() |
OutputStream |
getOutputStream() |
int |
getRecipient() |
int |
getRemoteMaxPacketSize() |
long |
getRemoteWinSize() |
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(String reqType,
SSHPacket buf) |
protected void |
init(int recipient,
long remoteWinSize,
long remoteMaxPacketSize) |
boolean |
isOpen() |
void |
join() |
void |
join(int timeout,
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(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.
|
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, String type)
protected void init(int recipient,
long remoteWinSize,
long remoteMaxPacketSize)
public boolean getAutoExpand()
getAutoExpand in interface ChannelChannel.setAutoExpand(boolean)public InputStream getInputStream()
getInputStream in interface ChannelInputStream for this channel.public int getLocalMaxPacketSize()
getLocalMaxPacketSize in interface Channelpublic long getLocalWinSize()
getLocalWinSize in interface Channelpublic OutputStream getOutputStream()
getOutputStream in interface ChannelOutputStream for this channel.public int getRecipient()
getRecipient in interface Channelpublic int getRemoteMaxPacketSize()
getRemoteMaxPacketSize in interface Channelpublic long getRemoteWinSize()
getRemoteWinSize in interface Channelpublic 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 requestConnectionExceptionTransportExceptionprotected 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 Closeableclose in interface AutoCloseableclose in interface ChannelConnectionExceptionTransportExceptionpublic void join()
throws ConnectionException
join in interface ChannelConnectionExceptionpublic void join(int timeout,
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(String reqType, SSHPacket buf) throws ConnectionException, TransportException
protected void receiveInto(ChannelInputStream stream, SSHPacket buf) throws ConnectionException, TransportException
protected Event<ConnectionException> sendChannelRequest(String reqType, boolean wantReply, Buffer.PlainBuffer reqSpecific) throws TransportException
TransportExceptionprotected void eofInputStreams()
Copyright © 2009–2014. All rights reserved.