Package org.apache.sshd.client.channel
Enum AbstractClientChannel.NullIoInputStream
- java.lang.Object
-
- java.lang.Enum<AbstractClientChannel.NullIoInputStream>
-
- org.apache.sshd.client.channel.AbstractClientChannel.NullIoInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Serializable
,java.lang.AutoCloseable
,java.lang.Comparable<AbstractClientChannel.NullIoInputStream>
,java.nio.channels.Channel
,Closeable
,IoInputStream
- Enclosing class:
- AbstractClientChannel
private static enum AbstractClientChannel.NullIoInputStream extends java.lang.Enum<AbstractClientChannel.NullIoInputStream> implements IoInputStream
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Field Summary
Fields Modifier and Type Field Description private CloseFuture
closing
-
Constructor Summary
Constructors Modifier Constructor Description private
NullIoInputStream()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCloseFutureListener(SshFutureListener<CloseFuture> listener)
Pre-register a listener to be informed when resource is closed.CloseFuture
close(boolean immediately)
Close this resource asynchronously and return a future.boolean
isClosed()
Returnstrue
if this object has been closed.boolean
isClosing()
Returnstrue
if theCloseable.close(boolean)
method has been called.IoReadFuture
read(Buffer buffer)
NOTE: the buffer must not be touched until the returned read future is completed.void
removeCloseFutureListener(SshFutureListener<CloseFuture> listener)
Remove a pre-registered close event listenerstatic AbstractClientChannel.NullIoInputStream
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static AbstractClientChannel.NullIoInputStream[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final AbstractClientChannel.NullIoInputStream INSTANCE
-
-
Field Detail
-
closing
private final CloseFuture closing
-
-
Method Detail
-
values
public static AbstractClientChannel.NullIoInputStream[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (AbstractClientChannel.NullIoInputStream c : AbstractClientChannel.NullIoInputStream.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AbstractClientChannel.NullIoInputStream valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
close
public CloseFuture close(boolean immediately)
Description copied from interface:Closeable
Close this resource asynchronously and return a future. Resources support two closing modes: a graceful mode which will cleanly close the resource and an immediate mode which will close the resources abruptly.- Specified by:
close
in interfaceCloseable
- Parameters:
immediately
-true
if the resource should be shut down abruptly,false
for a graceful close- Returns:
- a
CloseFuture
representing the close request
-
addCloseFutureListener
public void addCloseFutureListener(SshFutureListener<CloseFuture> listener)
Description copied from interface:Closeable
Pre-register a listener to be informed when resource is closed. If resource is already closed, the listener will be invoked immediately and not registered for future notification- Specified by:
addCloseFutureListener
in interfaceCloseable
- Parameters:
listener
- The notificationSshFutureListener
- nevernull
-
removeCloseFutureListener
public void removeCloseFutureListener(SshFutureListener<CloseFuture> listener)
Description copied from interface:Closeable
Remove a pre-registered close event listener- Specified by:
removeCloseFutureListener
in interfaceCloseable
- Parameters:
listener
- The registerSshFutureListener
- nevernull
. Ignored if not registered or resource already closed
-
isClosed
public boolean isClosed()
Description copied from interface:Closeable
Returnstrue
if this object has been closed.
-
isClosing
public boolean isClosing()
Description copied from interface:Closeable
Returnstrue
if theCloseable.close(boolean)
method has been called. Note that this method will returntrue
even if thisCloseable.isClosed()
returnstrue
.
-
read
public IoReadFuture read(Buffer buffer)
Description copied from interface:IoInputStream
NOTE: the buffer must not be touched until the returned read future is completed.- Specified by:
read
in interfaceIoInputStream
- Parameters:
buffer
- theBuffer
to use- Returns:
- The
IoReadFuture
for the operation
-
-