Top Description Methods
org.apache.sshd.common.future

public Interface WaitableFuture

Known Direct Subinterfaces
org.apache.sshd.common.future.SshFuture
Imports
java.io.IOException, java.time.Duration, java.util.concurrent.TimeUnit

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.

Author
Apache MINA SSHD Project

Method Summary

Modifier and TypeMethod and Description
public default boolean

Returns:

true if the operation is completed.
await
()

Wait Long#MAX_VALUE msec.

public default boolean

Returns:

true if the operation is completed.
await
(CancelOption...
Optional CancelOptions defining the behavior on time-out or interrupt; ignored if the future is not Cancellable.
options
)

Wait Long#MAX_VALUE msec.

public default boolean

Returns:

true if the operation is completed.
await
(long
The number of time units to wait
timeout
,
TimeUnit
The TimeUnit for waiting
unit
)

Wait for the asynchronous operation to complete with the specified timeout.

public default boolean

Returns:

true if the operation is completed.
await
(long
The number of time units to wait
timeout
,
TimeUnit
The TimeUnit for waiting
unit
,
CancelOption...
Optional CancelOptions defining the behavior on time-out or interrupt; ignored if the future is not Cancellable.
options
)

Wait for the asynchronous operation to complete with the specified timeout.

public default boolean

Returns:

true if the operation is completed.
await
(Duration
The maximum duration to wait, null to wait forever
timeout
)

Wait for the asynchronous operation to complete with the specified timeout.

public default boolean

Returns:

true if the operation is completed.
await
(Duration
The maximum duration to wait, null to wait forever
timeout
,
CancelOption...
Optional CancelOptions defining the behavior on time-out or interrupt; ignored if the future is not Cancellable.
options
)

Wait for the asynchronous operation to complete with the specified timeout.

public default boolean

Returns:

true if the operation is completed.
await
(long
Wait time in milliseconds
timeoutMillis
)

Wait for the asynchronous operation to complete with the specified timeout.

public boolean

Returns:

true if the operation is completed.
await
(long
Wait time in milliseconds
timeoutMillis
,
CancelOption...
Optional CancelOptions defining the behavior on time-out or interrupt; ignored if the future is not Cancellable.
options
)

Wait for the asynchronous operation to complete with the specified timeout.

public default boolean

Returns:

true if the operation is completed.
awaitUninterruptibly
()

Wait Long#MAX_VALUE msec.

public default boolean

Returns:

true if the operation is completed.
awaitUninterruptibly
(CancelOption...
Optional CancelOptions defining the behavior on time-out; ignored if the future is not Cancellable.
options
)

Wait Long#MAX_VALUE msec.

public default boolean

Returns:

true if the operation is completed.
awaitUninterruptibly
(long
The number of time units to wait
timeout
,
TimeUnit
The TimeUnit for waiting
unit
)

Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.

public default boolean

Returns:

true if the operation is completed.
awaitUninterruptibly
(long
The number of time units to wait
timeout
,
TimeUnit
The TimeUnit for waiting
unit
,
CancelOption...
Optional CancelOptions defining the behavior on time-out; ignored if the future is not Cancellable.
options
)

Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.

public default boolean

Returns:

true if the operation is finished.
awaitUninterruptibly
(Duration
Wait time, null to wait forever
timeoutMillis
)

Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.

public default boolean

Returns:

true if the operation is finished.
awaitUninterruptibly
(Duration
Wait time, null to wait forever
timeoutMillis
,
CancelOption...
Optional CancelOptions defining the behavior on time-out; ignored if the future is not Cancellable.
options
)

Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.

public default boolean

Returns:

true if the operation is finished.
awaitUninterruptibly
(long
Wait time in milliseconds
timeoutMillis
)

Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.

public boolean

Returns:

true if the operation is finished.
awaitUninterruptibly
(long
Wait time in milliseconds
timeoutMillis
,
CancelOption...
Optional CancelOptions defining the behavior on time-out; ignored if the future is not Cancellable.
options
)

Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.

public Object

Returns:

Some identifier useful as toString() value
getId
()

public boolean

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.

isDone
()

Method Detail

awaitback to summary
public default boolean await() throws IOException

Wait Long#MAX_VALUE msec. for the asynchronous operation to complete. The attached listeners will be notified when the operation is completed.

Returns:boolean

true if the operation is completed.

Exceptions
IOException:
if failed - specifically java.io.InterruptedIOException if waiting was interrupted
See Also
await(long, CancelOption[])
awaitback to summary
public default boolean await(CancelOption... options) throws IOException

Wait Long#MAX_VALUE msec. for the asynchronous operation to complete. The attached listeners will be notified when the operation is completed.

Parameters
options:CancelOption[]

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

Returns:boolean

true if the operation is completed.

Exceptions
IOException:
if failed - specifically java.io.InterruptedIOException if waiting was interrupted
See Also
await(long, CancelOption[])
awaitback to summary
public default boolean await(long timeout, TimeUnit unit) throws IOException

Wait for the asynchronous operation to complete with the specified timeout.

Parameters
timeout:long

The number of time units to wait

unit:TimeUnit

The TimeUnit for waiting

Returns:boolean

true if the operation is completed.

Exceptions
IOException:
if failed - specifically java.io.InterruptedIOException if waiting was interrupted
See Also
await(long, CancelOption[])
awaitback to summary
public default boolean await(long timeout, TimeUnit unit, CancelOption... options) throws IOException

Wait for the asynchronous operation to complete with the specified timeout.

Parameters
timeout:long

The number of time units to wait

unit:TimeUnit

The TimeUnit for waiting

options:CancelOption[]

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

Returns:boolean

true if the operation is completed.

Exceptions
IOException:
if failed - specifically java.io.InterruptedIOException if waiting was interrupted
See Also
await(long, CancelOption[])
awaitback to summary
public default boolean await(Duration timeout) throws IOException

Wait for the asynchronous operation to complete with the specified timeout.

Parameters
timeout:Duration

The maximum duration to wait, null to wait forever

Returns:boolean

true if the operation is completed.

Exceptions
IOException:
if failed - specifically java.io.InterruptedIOException if waiting was interrupted
See Also
await(long, CancelOption[])
awaitback to summary
public default boolean await(Duration timeout, CancelOption... options) throws IOException

Wait for the asynchronous operation to complete with the specified timeout.

Parameters
timeout:Duration

The maximum duration to wait, null to wait forever

options:CancelOption[]

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

Returns:boolean

true if the operation is completed.

Exceptions
IOException:
if failed - specifically java.io.InterruptedIOException if waiting was interrupted
See Also
await(long, CancelOption[])
awaitback to summary
public default boolean await(long timeoutMillis) throws IOException

Wait for the asynchronous operation to complete with the specified timeout.

Parameters
timeoutMillis:long

Wait time in milliseconds

Returns:boolean

true if the operation is completed.

Exceptions
IOException:
if failed - specifically java.io.InterruptedIOException if waiting was interrupted
awaitback to summary
public boolean await(long timeoutMillis, CancelOption... options) throws IOException

Wait for the asynchronous operation to complete with the specified timeout.

Parameters
timeoutMillis:long

Wait time in milliseconds

options:CancelOption[]

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

Returns:boolean

true if the operation is completed.

Exceptions
IOException:
if failed - specifically java.io.InterruptedIOException if waiting was interrupted
awaitUninterruptiblyback to summary
public default boolean awaitUninterruptibly()

Wait Long#MAX_VALUE msec. for the asynchronous operation to complete uninterruptibly. The attached listeners will be notified when the operation is completed.

Returns:boolean

true if the operation is completed.

See Also
awaitUninterruptibly(long, CancelOption[])
awaitUninterruptiblyback to summary
public default boolean awaitUninterruptibly(CancelOption... options)

Wait Long#MAX_VALUE msec. for the asynchronous operation to complete uninterruptibly. The attached listeners will be notified when the operation is completed.

Parameters
options:CancelOption[]

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

Returns:boolean

true if the operation is completed.

See Also
awaitUninterruptibly(long, CancelOption[])
awaitUninterruptiblyback to summary
public default boolean awaitUninterruptibly(long timeout, TimeUnit unit)

Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.

Parameters
timeout:long

The number of time units to wait

unit:TimeUnit

The TimeUnit for waiting

Returns:boolean

true if the operation is completed.

See Also
awaitUninterruptibly(long, CancelOption[])
awaitUninterruptiblyback to summary
public default boolean awaitUninterruptibly(long timeout, TimeUnit unit, CancelOption... options)

Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.

Parameters
timeout:long

The number of time units to wait

unit:TimeUnit

The TimeUnit for waiting

options:CancelOption[]

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

Returns:boolean

true if the operation is completed.

See Also
awaitUninterruptibly(long, CancelOption[])
awaitUninterruptiblyback to summary
public default boolean awaitUninterruptibly(Duration timeoutMillis)

Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.

Parameters
timeoutMillis:Duration

Wait time, null to wait forever

Returns:boolean

true if the operation is finished.

awaitUninterruptiblyback to summary
public default boolean awaitUninterruptibly(Duration timeoutMillis, CancelOption... options)

Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.

Parameters
timeoutMillis:Duration

Wait time, null to wait forever

options:CancelOption[]

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

Returns:boolean

true if the operation is finished.

awaitUninterruptiblyback to summary
public default boolean awaitUninterruptibly(long timeoutMillis)

Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.

Parameters
timeoutMillis:long

Wait time in milliseconds

Returns:boolean

true if the operation is finished.

awaitUninterruptiblyback to summary
public boolean awaitUninterruptibly(long timeoutMillis, CancelOption... options)

Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.

Parameters
timeoutMillis:long

Wait time in milliseconds

options:CancelOption[]

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

Returns:boolean

true if the operation is finished.

getIdback to summary
public Object getId()
Returns:Object

Some identifier useful as toString() value

isDoneback to summary
public boolean isDone()
Returns:boolean

true if the asynchronous operation is completed

Note

it is up to the caller to determine whether it was a successful or failed completion.