Package org.apache.sshd.common.future
Interface WaitableFuture
- All Known Subinterfaces:
AuthFuture
,CancelFuture
,CloseFuture
,ConnectFuture
,IoConnectFuture
,IoReadFuture
,IoWriteFuture
,KeyExchangeFuture
,OpenFuture
,SshFuture<T>
- All Known Implementing Classes:
AbstractIoWriteFuture
,AbstractSshFuture
,ChannelAsyncInputStream.IoReadFutureImpl
,ChannelAsyncOutputStream.BufferedFuture
,DefaultAuthFuture
,DefaultCancelFuture
,DefaultCancellableSshFuture
,DefaultCloseFuture
,DefaultConnectFuture
,DefaultIoConnectFuture
,DefaultKeyExchangeFuture
,DefaultOpenFuture
,DefaultSshFuture
,DefaultVerifiableSshFuture
,GlobalRequestFuture
,IoWriteFutureImpl
,Nio2DefaultIoWriteFuture
,PendingWriteFuture
,SimpleIoOutputStream.DefaultIoWriteFuture
public interface WaitableFuture
Represents an asynchronous operation which one can wait for its completion. Note: the only thing guaranteed is
that if
true
is returned from one of the awaitXXX
methods then the operation has completed. However,
the caller has to determine whether it was a successful or failed completion.-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
await
(long timeout, TimeUnit unit, CancelOption... options) Wait for the asynchronous operation to complete with the specified timeout.boolean
await
(long timeoutMillis, CancelOption... options) Wait for the asynchronous operation to complete with the specified timeout.default boolean
await
(Duration timeout, CancelOption... options) Wait for the asynchronous operation to complete with the specified timeout.default boolean
await
(CancelOption... options) WaitLong.MAX_VALUE
msec.default boolean
awaitUninterruptibly
(long timeout, TimeUnit unit, CancelOption... options) Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.boolean
awaitUninterruptibly
(long timeoutMillis, CancelOption... options) Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.default boolean
awaitUninterruptibly
(Duration timeoutMillis, CancelOption... options) Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.default boolean
awaitUninterruptibly
(CancelOption... options) WaitLong.MAX_VALUE
msec.getId()
boolean
isDone()
-
Method Details
-
getId
Object getId()- Returns:
- Some identifier useful as
toString()
value
-
await
WaitLong.MAX_VALUE
msec. for the asynchronous operation to complete. The attached listeners will be notified when the operation is completed.- Parameters:
options
- Optionalinvalid reference
CancelOptions
Cancellable
.- Returns:
true
if the operation is completed.- Throws:
IOException
- if failed - specificallyInterruptedIOException
if waiting was interrupted- See Also:
-
await
Wait for the asynchronous operation to complete with the specified timeout.- Parameters:
timeout
- The number of time units to waitunit
- TheTimeUnit
for waitingoptions
- Optionalinvalid reference
CancelOptions
Cancellable
.- Returns:
true
if the operation is completed.- Throws:
IOException
- if failed - specificallyInterruptedIOException
if waiting was interrupted- See Also:
-
await
Wait for the asynchronous operation to complete with the specified timeout.- Parameters:
timeout
- The maximum duration to wait,null
to wait foreveroptions
- Optionalinvalid reference
CancelOptions
Cancellable
.- Returns:
true
if the operation is completed.- Throws:
IOException
- if failed - specificallyInterruptedIOException
if waiting was interrupted- See Also:
-
await
Wait for the asynchronous operation to complete with the specified timeout.- Parameters:
timeoutMillis
- Wait time in millisecondsoptions
- Optionalinvalid reference
CancelOptions
Cancellable
.- Returns:
true
if the operation is completed.- Throws:
IOException
- if failed - specificallyInterruptedIOException
if waiting was interrupted
-
awaitUninterruptibly
WaitLong.MAX_VALUE
msec. for the asynchronous operation to complete uninterruptibly. The attached listeners will be notified when the operation is completed.- Parameters:
options
- Optionalinvalid reference
CancelOptions
Cancellable
.- Returns:
true
if the operation is completed.- See Also:
-
awaitUninterruptibly
Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.- Parameters:
timeout
- The number of time units to waitunit
- TheTimeUnit
for waitingoptions
- Optionalinvalid reference
CancelOptions
Cancellable
.- Returns:
true
if the operation is completed.- See Also:
-
awaitUninterruptibly
Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.- Parameters:
timeoutMillis
- Wait time,null
to wait foreveroptions
- Optionalinvalid reference
CancelOptions
Cancellable
.- Returns:
true
if the operation is finished.
-
awaitUninterruptibly
Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.- Parameters:
timeoutMillis
- Wait time in millisecondsoptions
- Optionalinvalid reference
CancelOptions
Cancellable
.- Returns:
true
if the operation is finished.
-
isDone
boolean isDone()- Returns:
true
if the asynchronous operation is completed. Note: it is up to the caller to determine whether it was a successful or failed completion.
-