Package org.apache.sshd.common.future
Interface Cancellable
-
- All Superinterfaces:
HasException
,WithException
- All Known Subinterfaces:
AuthFuture
,ConnectFuture
,IoConnectFuture
,OpenFuture
- All Known Implementing Classes:
DefaultAuthFuture
,DefaultCancellableSshFuture
,DefaultConnectFuture
,DefaultIoConnectFuture
,DefaultOpenFuture
public interface Cancellable extends WithException
Some operation that can be cancelled.Classes implementing this interface that support state listeners are expected to notify the listeners when
cancel()
changes the state of the operation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CancelFuture
cancel()
Attempts to cancel the operation.CancelFuture
getCancellation()
Retrieves theCancelFuture
, ifcancel()
had been called.boolean
isCanceled()
Tells whether this operation was canceled.-
Methods inherited from interface org.apache.sshd.common.future.HasException
getException
-
Methods inherited from interface org.apache.sshd.common.future.WithException
setException
-
-
-
-
Method Detail
-
cancel
CancelFuture cancel()
Attempts to cancel the operation.- Returns:
- A
CancelFuture
that can be used to wait for the cancellation to have been effected, ornull
if the future cannot be canceled or is already completed.
-
isCanceled
boolean isCanceled()
Tells whether this operation was canceled.- Returns:
true
if the operation was cancelled,false
otherwise.
-
getCancellation
CancelFuture getCancellation()
Retrieves theCancelFuture
, ifcancel()
had been called.- Returns:
- The
CancelFuture
if theCancellable
has already been canceled, ornull
otherwise
-
-