Package com.sshtools.j2ssh.connection
Class Channel
java.lang.Object
com.sshtools.j2ssh.connection.Channel
- Direct Known Subclasses:
BindingChannel,IOChannel,SocketChannel,SubsystemChannel
- Version:
- $Revision: 1.74 $
- Author:
- $author$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ConnectionProtocolprotected longprotected longprotected ChannelDataWindowprotected longprotected longprotected ChannelDataWindowprotected ChannelState -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventListener(ChannelEventListener eventListener) voidclose()protected voidabstract byte[]abstract byte[]abstract Stringlonglongprotected abstract intprotected abstract intprotected abstract intgetName()longlonggetState()protected voidinit(ConnectionProtocol connection, long localChannelId, long senderChannelId, long initialWindowSize, long maximumPacketSize) protected voidinit(ConnectionProtocol connection, long localChannelId, long senderChannelId, long initialWindowSize, long maximumPacketSize, ChannelEventListener eventListener) booleanisClosed()booleanbooleanisOpen()booleanprotected abstract voidprotected abstract voidprotected abstract voidprotected abstract voidprotected abstract voidprotected abstract voidonChannelRequest(String requestType, boolean wantReply, byte[] requestData) protected voidopen()protected voidprotected voidprotected voidprotected voidsendChannelData(byte[] data) protected voidsendChannelExtData(int type, byte[] data) voidvoidprotected void
-
Field Details
-
localWindow
-
remoteWindow
-
connection
-
localChannelId
protected long localChannelId -
localPacketSize
protected long localPacketSize -
remoteChannelId
protected long remoteChannelId -
remotePacketSize
protected long remotePacketSize -
state
-
-
Constructor Details
-
Channel
public Channel()Creates a new Channel object.
-
-
Method Details
-
getChannelOpenData
public abstract byte[] getChannelOpenData()- Returns:
-
getChannelConfirmationData
public abstract byte[] getChannelConfirmationData()- Returns:
-
getChannelType
- Returns:
-
getMinimumWindowSpace
protected abstract int getMinimumWindowSpace()- Returns:
-
getMaximumWindowSpace
protected abstract int getMaximumWindowSpace()- Returns:
-
getMaximumPacketSize
protected abstract int getMaximumPacketSize()- Returns:
-
onChannelData
- Parameters:
msg-- Throws:
IOException
-
processChannelData
- Parameters:
msg-- Throws:
IOException
-
isClosed
public boolean isClosed()- Returns:
-
isOpen
public boolean isOpen()- Returns:
-
sendChannelData
- Parameters:
data-- Throws:
IOException
-
sendChannelExtData
- Parameters:
type-data-- Throws:
IOException
-
onChannelExtData
- Parameters:
msg-- Throws:
IOException
-
processChannelData
- Parameters:
msg-- Throws:
IOException
-
getLocalChannelId
public long getLocalChannelId()- Returns:
-
getLocalPacketSize
public long getLocalPacketSize()- Returns:
-
getLocalWindow
- Returns:
-
getRemoteChannelId
public long getRemoteChannelId()- Returns:
-
getRemotePacketSize
public long getRemotePacketSize()- Returns:
-
getRemoteWindow
- Returns:
-
getState
- Returns:
-
close
- Throws:
IOException
-
remoteClose
- Throws:
IOException
-
finalizeClose
- Throws:
IOException
-
setLocalEOF
- Throws:
IOException
-
isLocalEOF
public boolean isLocalEOF()- Returns:
-
isRemoteEOF
public boolean isRemoteEOF()- Returns:
-
setRemoteEOF
- Throws:
IOException
-
addEventListener
- Parameters:
eventListener-
-
init
protected void init(ConnectionProtocol connection, long localChannelId, long senderChannelId, long initialWindowSize, long maximumPacketSize) throws IOException - Parameters:
connection-localChannelId-senderChannelId-initialWindowSize-maximumPacketSize-- Throws:
IOException
-
open
- Throws:
IOException
-
init
protected void init(ConnectionProtocol connection, long localChannelId, long senderChannelId, long initialWindowSize, long maximumPacketSize, ChannelEventListener eventListener) throws IOException - Parameters:
connection-localChannelId-senderChannelId-initialWindowSize-maximumPacketSize-eventListener-- Throws:
IOException
-
onChannelClose
- Throws:
IOException
-
onChannelEOF
- Throws:
IOException
-
onChannelOpen
- Throws:
IOException
-
onChannelRequest
protected abstract void onChannelRequest(String requestType, boolean wantReply, byte[] requestData) throws IOException - Parameters:
requestType-wantReply-requestData-- Throws:
IOException
-
setName
- Parameters:
name-
-
getName
- Returns:
-