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 CloseFutureclosing
-
Constructor Summary
Constructors Modifier Constructor Description privateNullIoInputStream()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCloseFutureListener(SshFutureListener<CloseFuture> listener)Pre-register a listener to be informed when resource is closed.CloseFutureclose(boolean immediately)Close this resource asynchronously and return a future.booleanisClosed()Returnstrueif this object has been closed.booleanisClosing()Returnstrueif theCloseable.close(boolean)method has been called.IoReadFutureread(Buffer buffer)NOTE: the buffer must not be touched until the returned read future is completed.voidremoveCloseFutureListener(SshFutureListener<CloseFuture> listener)Remove a pre-registered close event listenerstatic AbstractClientChannel.NullIoInputStreamvalueOf(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:CloseableClose 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:
closein interfaceCloseable- Parameters:
immediately-trueif the resource should be shut down abruptly,falsefor a graceful close- Returns:
- a
CloseFuturerepresenting the close request
-
addCloseFutureListener
public void addCloseFutureListener(SshFutureListener<CloseFuture> listener)
Description copied from interface:CloseablePre-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:
addCloseFutureListenerin interfaceCloseable- Parameters:
listener- The notificationSshFutureListener- nevernull
-
removeCloseFutureListener
public void removeCloseFutureListener(SshFutureListener<CloseFuture> listener)
Description copied from interface:CloseableRemove a pre-registered close event listener- Specified by:
removeCloseFutureListenerin interfaceCloseable- Parameters:
listener- The registerSshFutureListener- nevernull. Ignored if not registered or resource already closed
-
isClosed
public boolean isClosed()
Description copied from interface:CloseableReturnstrueif this object has been closed.
-
isClosing
public boolean isClosing()
Description copied from interface:CloseableReturnstrueif theCloseable.close(boolean)method has been called. Note that this method will returntrueeven if thisCloseable.isClosed()returnstrue.
-
read
public IoReadFuture read(Buffer buffer)
Description copied from interface:IoInputStreamNOTE: the buffer must not be touched until the returned read future is completed.- Specified by:
readin interfaceIoInputStream- Parameters:
buffer- theBufferto use- Returns:
- The
IoReadFuturefor the operation
-
-