Package org.apache.sshd.client.future
Interface AuthFuture
- All Superinterfaces:
Cancellable,SshFuture<AuthFuture>,VerifiableFuture<AuthFuture>,WaitableFuture,WithException
- All Known Implementing Classes:
DefaultAuthFuture
public interface AuthFuture
extends SshFuture<AuthFuture>, VerifiableFuture<AuthFuture>, Cancellable
An
SshFuture for asynchronous authentication requests.-
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanvoidsetAuthed(boolean authed) Notifies that the session has been authenticated.voidsetCancellable(boolean cancellable) Enables or disables cancellation of thisAuthFuture.booleanTells whetherCancellable.cancel()was called on thisAuthFuture.Methods inherited from interface org.apache.sshd.common.future.Cancellable
cancel, getCancellation, isCanceledMethods inherited from interface org.apache.sshd.common.future.SshFuture
addListener, removeListenerMethods inherited from interface org.apache.sshd.common.future.VerifiableFuture
verify, verify, verify, verifyMethods inherited from interface org.apache.sshd.common.future.WaitableFuture
await, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, getId, isDoneMethods inherited from interface org.apache.sshd.common.future.WithException
getException, setException
-
Method Details
-
isSuccess
boolean isSuccess()- Returns:
trueif the authentication operation is finished successfully. Note: calling this method while the operation is in progress returnsfalse. Should checkWaitableFuture.isDone()in order to ensure that the result is valid.
-
isFailure
boolean isFailure()- Returns:
falseif the authentication operation failed. Note: the operation is considered failed if an exception is received instead of a success/fail response code or the operation is in progress. Should checkWaitableFuture.isDone()in order to ensure that the result is valid.
-
setAuthed
void setAuthed(boolean authed) Notifies that the session has been authenticated. This method is invoked by SSHD internally. Please do not call this method directly.- Parameters:
authed- Authentication success state
-
setCancellable
void setCancellable(boolean cancellable) Enables or disables cancellation of thisAuthFuture.This is a framework method; do not call directly.
- Parameters:
cancellable- whether this future is currently cancellable
-
wasCanceled
boolean wasCanceled()Tells whetherCancellable.cancel()was called on thisAuthFuture.This is different from
Cancellable.isCanceled(). Canceling an on-going authentication may not be possible;Cancellable.cancel()is only a request to cancel the authentication. That request may not be honored and theCancelFuturemay actually beisCanceled()== false.AuthFuture.Cancellable.isCanceled()is thenfalse, too.- Returns:
trueifCancellable.cancel()was called,falseotherwise
-