|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sshtools.j2ssh.connection.Channel
Implements an SSH connection protocol channel.
Constructor Summary | |
Channel(java.lang.String channelType,
long remoteChannelId,
long remoteWindowSize,
long remotePacketSize)
Constructor for the Channel when the channel request comes from the remote side. |
|
Channel(java.lang.String channelName,
java.lang.String channelType,
long windowSize,
long packetSize)
The constructor for the Channel when the local side request the channel to be opened. |
Method Summary | |
protected void |
close()
Closes the channel. |
protected void |
consumeLocalWindow(long count)
Consumes local window space. |
protected void |
consumeRemoteWindow(long count)
Consumes remote window space. |
java.lang.String |
getChannelName()
Gets the channel name. |
byte[] |
getChannelOpenData()
Gets the SSH_MSG_CHANNEL_OPEN message data. |
java.lang.String |
getChannelType()
Gets the channel type. |
long |
getLocalChannelId()
Returns the local channel id. |
long |
getLocalPacketSize()
Gets the local maximum packet size. |
long |
getLocalWindowSize()
Returns the current local window size. |
long |
getRemoteChannelId()
Returns the remote channel id. |
long |
getRemotePacketSize()
Gets the remote maximum packet size. |
long |
getRemoteWindowSize()
Returns the current remote window size. |
void |
increaseLocalWindowSize(long count)
Increases the local window size. |
protected void |
increaseRemoteWindowSize(long count)
Increases the remote window size. |
boolean |
isClosed()
Returns true if the channel is closed. |
boolean |
isLocalEOF()
Returns true if the local side is EOF. |
boolean |
isRemoteEOF()
Returns true if the remote side is EOF. |
void |
setChannelOpenData(byte[] data)
Sets the SSH_MSG_CHANNEL_OPEN request data. |
protected void |
setLocalEOF()
Sets the local side as End Of File. |
protected void |
setLocalPacketSize(long packetSize)
Sets the local maximum packet size. |
protected void |
setRemoteChannelId(long channelId)
Sets the remote channel id. |
protected void |
setRemoteEOF()
Sets the remote side as End Of File. |
protected void |
setRemotePacketSize(long packetSize)
Sets the remote maximum packet size. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Channel(java.lang.String channelName, java.lang.String channelType, long windowSize, long packetSize)
The constructor for the Channel when the local side request the channel to be opened.
channelName
- The channel name (this can be anything you want to
identify with)channelType
- The SSH channel typewindowSize
- The local window size for the channelpacketSize
- The maximum packet sizepublic Channel(java.lang.String channelType, long remoteChannelId, long remoteWindowSize, long remotePacketSize)
Constructor for the Channel when the channel request comes from the remote side.
channelType
- The SSH channel typeremoteChannelId
- The remote sides channel idremoteWindowSize
- The remote sides window sizeremotePacketSize
- The remote sides maximum packet sizeMethod Detail |
public void setChannelOpenData(byte[] data)
Sets the SSH_MSG_CHANNEL_OPEN request data.
data
- public byte[] getChannelOpenData()
Gets the SSH_MSG_CHANNEL_OPEN message data.
public java.lang.String getChannelType()
Gets the channel type.
public java.lang.String getChannelName()
Gets the channel name. This is a descriptive name that you can use to identify the channel to your own application.
public long getLocalChannelId()
Returns the local channel id.
public long getLocalWindowSize()
Returns the current local window size.
public long getRemoteWindowSize()
Returns the current remote window size.
public long getRemoteChannelId()
Returns the remote channel id.
public void increaseLocalWindowSize(long count)
Increases the local window size.
count
- The number of bytes to add.protected void increaseRemoteWindowSize(long count)
Increases the remote window size.
count
- The number of bytes to add.protected void consumeRemoteWindow(long count)
Consumes remote window space.
count
- The number of bytes to consume.protected void consumeLocalWindow(long count)
Consumes local window space.
count
- The number of bytes to consume.protected void setRemoteChannelId(long channelId)
Sets the remote channel id.
channelId
- public long getRemotePacketSize()
Gets the remote maximum packet size.
public long getLocalPacketSize()
Gets the local maximum packet size.
protected void setRemotePacketSize(long packetSize)
Sets the remote maximum packet size.
packetSize
- protected void setLocalPacketSize(long packetSize)
Sets the local maximum packet size.
packetSize
- protected void close()
Closes the channel.
public boolean isClosed()
Returns true if the channel is closed.
protected void setLocalEOF()
Sets the local side as End Of File. No data can be received.
public boolean isLocalEOF()
Returns true if the local side is EOF.
protected void setRemoteEOF()
Sets the remote side as End Of File. No data can be sent.
public boolean isRemoteEOF()
Returns true if the remote side is EOF.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |