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
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
Modifier and TypeMethodDescriptioncancel()
Attempts to cancel the operation.Retrieves theCancelFuture
, ifcancel()
had been called.boolean
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 Details
-
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
-