Package org.apache.sshd.common.future
Interface Cancellable
- All Superinterfaces:
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.booleanTells whether this operation was canceled.Methods inherited from interface org.apache.sshd.common.future.WithException
getException, setException
-
Method Details
-
cancel
CancelFuture cancel()Attempts to cancel the operation.- Returns:
- A
CancelFuturethat can be used to wait for the cancellation to have been effected, ornullif the future cannot be canceled or is already completed.
-
isCanceled
boolean isCanceled()Tells whether this operation was canceled.- Returns:
trueif the operation was cancelled,falseotherwise.
-
getCancellation
CancelFuture getCancellation()Retrieves theCancelFuture, ifcancel()had been called.- Returns:
- The
CancelFutureif theCancellablehas already been canceled, ornullotherwise
-