Top Description Fields Constructors Methods
org.apache.sshd.common.channel

public abstract Class Window

extends AbstractLoggingBean
implements ChannelHolder, Closeable
Class Inheritance
All Implemented Interfaces
java.io.Closeable, java.lang.AutoCloseable, org.apache.sshd.common.channel.ChannelHolder
Known Direct Subclasses
org.apache.sshd.common.channel.LocalWindow, org.apache.sshd.common.channel.RemoteWindow
Imports
java.io.Closeable, .IOException, java.util.Objects, java.util.concurrent.atomic.AtomicBoolean, java.util.function.Predicate, org.apache.sshd.common.PropertyResolver, org.apache.sshd.common.util.ValidateUtils, org.apache.sshd.common.util.buffer.BufferUtils, org.apache.sshd.common.util.logging.AbstractLoggingBean, org.apache.sshd.core.CoreModuleProperties

A Channel implements a sliding window flow control for data packets (SSH_MSG_CHANNEL_DATA and SSH_MSG_CHANNEL_EXTENDED_DATA packets). Each channel has two windows, a local window describing how much data it is prepared to receive (and the peer is allowed to send), and a remote window that reflects this side's view of the peer's local window. When the local window size is zero, no data should be received; when the remote window size is zero, no data should be sent. Peers update the other's remote window periodically, but at the latest when a window is exhausted, by sending SSH_MSG_CHANNEL_WINDOW_ADJUST messages.
Author
Apache MINA SSHD Project
See Also
LocalWindow, RemoteWindow

Field Summary

Modifier and TypeField and Description
private final Channel
private final AtomicBoolean
private final AtomicBoolean
protected final Object
private long
private long
private long
private final String
Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
log

Constructor Summary

AccessConstructor and Description
protected
Window(Channel channel, boolean isClient)

Method Summary

Modifier and TypeMethod and Description
protected void
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.

public abstract void
consume(long len)

public Channel
public long
public long
public long
protected void
init(long size, long packetSize, PropertyResolver resolver)

public boolean
protected static Predicate<Window>
largerThan(long minSize)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

protected void
updateSize(long size)

Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
debugdebugdebugdebugdebugerrorerrorerrorerrorerrorgetSimplifiedLoggerinfoinfowarnwarnwarnwarnwarnwarnwarnwarn

Field Detail

channelInstanceback to summary
private final Channel channelInstance
closedback to summary
private final AtomicBoolean closed
initializedback to summary
private final AtomicBoolean initialized
lockback to summary
protected final Object lock
maxSizeback to summary
private long maxSize
packetSizeback to summary
private long packetSize
sizeback to summary
private long size
suffixback to summary
private final String suffix

Constructor Detail

Windowback to summary
protected Window(Channel channel, boolean isClient)

Method Detail

checkInitializedback to summary
protected void checkInitialized(String location)
closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
consumeback to summary
public abstract void consume(long len) throws IOException
getChannelback to summary
public Channel getChannel()

Implements org.apache.sshd.common.channel.ChannelHolder.getChannel.

Returns:Channel

Doc from org.apache.sshd.common.channel.ChannelHolder.getChannel.

The associated Channel instance

Annotations
@Override
getMaxSizeback to summary
public long getMaxSize()
getPacketSizeback to summary
public long getPacketSize()
getSizeback to summary
public long getSize()
initback to summary
protected void init(long size, long packetSize, PropertyResolver resolver)
isOpenback to summary
public boolean isOpen()
largerThanback to summary
protected static Predicate<Window> largerThan(long minSize)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
updateSizeback to summary
protected void updateSize(long size)