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

public Class ChannelAsyncInputStream

extends AbstractCloseable
implements IoInputStream, ChannelHolder
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.channel.ChannelHolder, org.apache.sshd.common.io.IoInputStream, org.apache.sshd.common.Closeable, java.nio.channels.Channel, java.io.Closeable, java.lang.AutoCloseable
Imports
java.io.EOFException, .IOException, java.util.Objects, org.apache.sshd.common.RuntimeSshException, org.apache.sshd.common.future.CancelOption, .CloseFuture, .DefaultVerifiableSshFuture, org.apache.sshd.common.io.IoInputStream, .IoReadFuture, .ReadPendingException, org.apache.sshd.common.session.Session, org.apache.sshd.common.util.Readable, org.apache.sshd.common.util.buffer.Buffer, .ByteArrayBuffer, org.apache.sshd.common.util.closeable.AbstractCloseable

Author
Apache MINA SSHD Project

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final Buffer
private final Channel
private ChannelAsyncInputStream.IoReadFutureImpl
private final Object
Inherited from org.apache.sshd.common.util.closeable.AbstractCloseable:
closeFuturefutureLockstate

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected CloseFuture
private void
doRead(boolean resume)

public Channel
protected void
preClose()

Overrides org.apache.sshd.common.util.closeable.AbstractCloseable.preClose.

preClose is guaranteed to be called before doCloseGracefully or doCloseImmediately.

public IoReadFuture
read(Buffer
the Buffer to use
buf
)

Implements org.apache.sshd.common.io.IoInputStream.read.

Note

the buffer must not be touched until the returned read future is completed.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
Inherited from org.apache.sshd.common.util.closeable.AbstractCloseable:
addCloseFutureListenerbuilderclosedoCloseImmediatelygetFutureLockisClosedisClosingremoveCloseFutureListener

Field Detail

bufferback to summary
private final Buffer buffer
channelInstanceback to summary
private final Channel channelInstance
pendingback to summary
private ChannelAsyncInputStream.IoReadFutureImpl pending
readFutureIdback to summary
private final Object readFutureId

Constructor Detail

ChannelAsyncInputStreamback to summary
public ChannelAsyncInputStream(Channel channel)

Method Detail

doCloseGracefullyback to summary
protected CloseFuture doCloseGracefully()

Overrides org.apache.sshd.common.util.closeable.AbstractCloseable.doCloseGracefully.

Annotations
@Override
doReadback to summary
private void doRead(boolean resume)
Annotations
@SuppressWarnings:synthetic-access
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
preCloseback to summary
protected void preClose()

Overrides org.apache.sshd.common.util.closeable.AbstractCloseable.preClose.

Doc from org.apache.sshd.common.util.closeable.AbstractCloseable.preClose.

preClose is guaranteed to be called before doCloseGracefully or doCloseImmediately. When preClose() is called, isClosing() == true

Annotations
@Override
readback to summary
public IoReadFuture read(Buffer buf)

Implements org.apache.sshd.common.io.IoInputStream.read.

Doc from org.apache.sshd.common.io.IoInputStream.read.

Note

the buffer must not be touched until the returned read future is completed.

Parameters
buf:Buffer

the Buffer to use

Returns:IoReadFuture

The IoReadFuture for the operation

Annotations
@Override
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
writeback to summary
public void write(Readable src) throws IOException
org.apache.sshd.common.channel back to summary

public Class ChannelAsyncInputStream.IoReadFutureImpl

extends DefaultVerifiableSshFuture<IoReadFuture>
implements IoReadFuture
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.io.IoReadFuture, org.apache.sshd.common.future.VerifiableFuture, org.apache.sshd.common.future.SshFuture, org.apache.sshd.common.future.WaitableFuture

Field Summary

Modifier and TypeField and Description
pack-priv final Buffer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Buffer
getBuffer()

Implements org.apache.sshd.common.io.IoReadFuture.getBuffer.

Retrieves the buffer data was read into.

public Throwable
getException()

Implements org.apache.sshd.common.io.IoReadFuture.getException.

Returns the cause of the read failure.

public int
getRead()

Implements org.apache.sshd.common.io.IoReadFuture.getRead.

Retrieves the number of bytes read.

public IoReadFuture
verify(long
Wait timeout in milliseconds
timeoutMillis
,
CancelOption...
Optional CancelOptions defining the behavior on time-out or interrupt; ignored if the future is not Cancellable.
options
)

Implements org.apache.sshd.common.future.VerifiableFuture.verify.

Wait and verify that the operation was successful

Field Detail

bufferback to summary
pack-priv final Buffer buffer

Constructor Detail

IoReadFutureImplback to summary
public IoReadFutureImpl(Object id, Buffer buffer)

Method Detail

getBufferback to summary
public Buffer getBuffer()

Implements org.apache.sshd.common.io.IoReadFuture.getBuffer.

Doc from org.apache.sshd.common.io.IoReadFuture.getBuffer.

Retrieves the buffer data was read into.

Returns:Buffer

the buffer, null if isDone() == false

Annotations
@Override
getExceptionback to summary
public Throwable getException()

Implements org.apache.sshd.common.io.IoReadFuture.getException.

Doc from org.apache.sshd.common.io.IoReadFuture.getException.

Returns the cause of the read failure. An java.io.EOFException indicates that nothing was read because the source of the read is exhausted.

Returns:Throwable

null if the read operation is not finished yet, or if the read attempt is successful (use isDone() to distinguish between the two).

Annotations
@Override
getReadback to summary
public int getRead()

Implements org.apache.sshd.common.io.IoReadFuture.getRead.

Doc from org.apache.sshd.common.io.IoReadFuture.getRead.

Retrieves the number of bytes read.

Returns:int

The number of bytes read, or -1 if the source of the read has been exhausted (is at EOF), or zero if the read is not done yet (isDone() == false)

Annotations
@Override
verifyback to summary
public IoReadFuture verify(long timeoutMillis, CancelOption... options) throws IOException

Implements org.apache.sshd.common.future.VerifiableFuture.verify.

Doc from org.apache.sshd.common.future.VerifiableFuture.verify.

Wait and verify that the operation was successful

Parameters
timeoutMillis:long

Wait timeout in milliseconds

options:CancelOption[]

Optional CancelOptions defining the behavior on time-out or interrupt; ignored if the future is not Cancellable.

Returns:IoReadFuture

The (same) future instance

Annotations
@Override
Exceptions
IOException:
If failed to verify successfully on time