public interface

Channel

implements Closeable ErrorNotifiable SSHPacketHandler
net.schmizz.sshj.connection.channel.Channel
Known Indirect Subclasses

Class Overview

A channel is the basic medium for application-layer data on top of an SSH transport.

Summary

Nested Classes
interface Channel.Direct Direct channels are those that are initiated by us. 
interface Channel.Forwarded Forwarded channels are those that are initiated by the server. 
Public Methods
abstract void close()
Close this channel.
abstract boolean getAutoExpand()
abstract int getID()
abstract InputStream getInputStream()
abstract int getLocalMaxPacketSize()
abstract long getLocalWinSize()
abstract OutputStream getOutputStream()
abstract int getRecipient()
abstract int getRemoteMaxPacketSize()
abstract long getRemoteWinSize()
abstract String getType()
abstract boolean isOpen()
abstract void join(int timeout, TimeUnit unit)
abstract void join()
abstract void sendEOF()
Sends an EOF message to the server for this channel; indicating that no more data will be sent by us.
abstract 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.
[Expand]
Inherited Methods
From interface java.io.Closeable
From interface net.schmizz.sshj.common.ErrorNotifiable
From interface net.schmizz.sshj.common.SSHPacketHandler

Public Methods

public abstract void close ()

Close this channel.

public abstract boolean getAutoExpand ()

Returns
  • whether auto-expansion of local window is set.

public abstract int getID ()

Returns
  • the channel ID

public abstract InputStream getInputStream ()

Returns
  • the InputStream for this channel.

public abstract int getLocalMaxPacketSize ()

Returns
  • the maximum packet size that we have specified.

public abstract long getLocalWinSize ()

Returns
  • the current local window size.

public abstract OutputStream getOutputStream ()

Returns
  • an OutputStream for this channel.

public abstract int getRecipient ()

Returns
  • the channel ID at the remote end.

public abstract int getRemoteMaxPacketSize ()

Returns
  • the maximum packet size as specified by the remote end.

public abstract long getRemoteWinSize ()

Returns
  • the current remote window size.

public abstract String getType ()

Returns
  • the channel type identifier.

public abstract boolean isOpen ()

Returns
  • whether the channel is open.

public abstract void join (int timeout, TimeUnit unit)

Parameters
timeout
unit

public abstract void join ()

public abstract void sendEOF ()

Sends an EOF message to the server for this channel; indicating that no more data will be sent by us. The OutputStream for this channel will be closed and no longer usable.

Throws
TransportException if there is an error sending the EOF message

public abstract 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. This is useful e.g. when a remote command produces a lot of output that would fill the local window but you are not interested in reading from its InputStream.

Parameters
autoExpand Whether local windows should automatically expand