com.sshtools.j2ssh.connection

Class Channel

Known Direct Subclasses:
BindingChannel, IOChannel, SocketChannel, SubsystemChannel

public abstract class Channel
extends java.lang.Object

Version:
$Revision: 1.74 $
Author:
$author$

Field Summary

protected ConnectionProtocol
connection
protected long
localChannelId
protected long
localPacketSize
protected ChannelDataWindow
localWindow
protected long
remoteChannelId
protected long
remotePacketSize
protected ChannelDataWindow
remoteWindow
protected ChannelState
state

Constructor Summary

Channel()
Creates a new Channel object.

Method Summary

void
addEventListener(ChannelEventListener eventListener)
void
close()
protected void
finalizeClose()
abstract byte[]
getChannelConfirmationData()
abstract byte[]
getChannelOpenData()
abstract String
getChannelType()
long
getLocalChannelId()
long
getLocalPacketSize()
ChannelDataWindow
getLocalWindow()
protected abstract int
getMaximumPacketSize()
protected abstract int
getMaximumWindowSpace()
protected abstract int
getMinimumWindowSpace()
String
getName()
long
getRemoteChannelId()
long
getRemotePacketSize()
ChannelDataWindow
getRemoteWindow()
ChannelState
getState()
protected void
init(ConnectionProtocol connection, long localChannelId, long senderChannelId, long initialWindowSize, long maximumPacketSize)
protected void
init(ConnectionProtocol connection, long localChannelId, long senderChannelId, long initialWindowSize, long maximumPacketSize, ChannelEventListener eventListener)
boolean
isClosed()
boolean
isLocalEOF()
boolean
isOpen()
boolean
isRemoteEOF()
protected abstract void
onChannelClose()
protected abstract void
onChannelData(SshMsgChannelData msg)
protected abstract void
onChannelEOF()
protected abstract void
onChannelExtData(SshMsgChannelExtendedData msg)
protected abstract void
onChannelOpen()
protected abstract void
onChannelRequest(String requestType, boolean wantReply, byte[] requestData)
protected void
open()
protected void
processChannelData(SshMsgChannelData msg)
protected void
processChannelData(SshMsgChannelExtendedData msg)
protected void
remoteClose()
protected void
sendChannelData(byte[] data)
protected void
sendChannelExtData(int type, byte[] data)
void
setLocalEOF()
void
setName(String name)
protected void
setRemoteEOF()

Field Details

connection

protected ConnectionProtocol connection

localChannelId

protected long localChannelId

localPacketSize

protected long localPacketSize

localWindow

protected ChannelDataWindow localWindow

remoteChannelId

protected long remoteChannelId

remotePacketSize

protected long remotePacketSize

remoteWindow

protected ChannelDataWindow remoteWindow

state

protected ChannelState state

Constructor Details

Channel

public Channel()
Creates a new Channel object.

Method Details

addEventListener

public void addEventListener(ChannelEventListener eventListener)
Parameters:
eventListener -

close

public void close()
            throws IOException

finalizeClose

protected void finalizeClose()
            throws IOException

getChannelConfirmationData

public abstract byte[] getChannelConfirmationData()
Returns:

getChannelOpenData

public abstract byte[] getChannelOpenData()
Returns:

getChannelType

public abstract String getChannelType()
Returns:

getLocalChannelId

public long getLocalChannelId()
Returns:

getLocalPacketSize

public long getLocalPacketSize()
Returns:

getLocalWindow

public ChannelDataWindow getLocalWindow()
Returns:

getMaximumPacketSize

protected abstract int getMaximumPacketSize()
Returns:

getMaximumWindowSpace

protected abstract int getMaximumWindowSpace()
Returns:

getMinimumWindowSpace

protected abstract int getMinimumWindowSpace()
Returns:

getName

public String getName()
Returns:

getRemoteChannelId

public long getRemoteChannelId()
Returns:

getRemotePacketSize

public long getRemotePacketSize()
Returns:

getRemoteWindow

public ChannelDataWindow getRemoteWindow()
Returns:

getState

public ChannelState getState()
Returns:

init

protected void init(ConnectionProtocol connection,
                    long localChannelId,
                    long senderChannelId,
                    long initialWindowSize,
                    long maximumPacketSize)
            throws IOException
Parameters:
connection -
localChannelId -
senderChannelId -
initialWindowSize -
maximumPacketSize -

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 -

isClosed

public boolean isClosed()
Returns:

isLocalEOF

public boolean isLocalEOF()
Returns:

isOpen

public boolean isOpen()
Returns:

isRemoteEOF

public boolean isRemoteEOF()
Returns:

onChannelClose

protected abstract void onChannelClose()
            throws IOException

onChannelData

protected abstract void onChannelData(SshMsgChannelData msg)
            throws IOException
Parameters:
msg -

onChannelEOF

protected abstract void onChannelEOF()
            throws IOException

onChannelExtData

protected abstract void onChannelExtData(SshMsgChannelExtendedData msg)
            throws IOException
Parameters:
msg -

onChannelOpen

protected abstract void onChannelOpen()
            throws IOException

onChannelRequest

protected abstract void onChannelRequest(String requestType,
                                         boolean wantReply,
                                         byte[] requestData)
            throws IOException
Parameters:
requestType -
wantReply -
requestData -

open

protected void open()
            throws IOException

processChannelData

protected void processChannelData(SshMsgChannelData msg)
            throws IOException
Parameters:
msg -

processChannelData

protected void processChannelData(SshMsgChannelExtendedData msg)
            throws IOException
Parameters:
msg -

remoteClose

protected void remoteClose()
            throws IOException

sendChannelData

protected void sendChannelData(byte[] data)
            throws IOException
Parameters:
data -

sendChannelExtData

protected void sendChannelExtData(int type,
                                  byte[] data)
            throws IOException
Parameters:
type -
data -

setLocalEOF

public void setLocalEOF()
            throws IOException

setName

public void setName(String name)
Parameters:
name -

setRemoteEOF

protected void setRemoteEOF()
            throws IOException

Copyright © 2002-2003 Lee David Painter & Contributors. All Rights Reserved.