Package org.apache.sshd.client.future
Interface AuthFuture
-
- All Superinterfaces:
SshFuture<AuthFuture>
,VerifiableFuture<AuthFuture>
,WaitableFuture
- All Known Implementing Classes:
DefaultAuthFuture
public interface AuthFuture extends SshFuture<AuthFuture>, VerifiableFuture<AuthFuture>
AnSshFuture
for asynchronous authentication requests.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cancel()
Cancels the authentication attempt and notifies all threads waiting for this future.java.lang.Throwable
getException()
Returns the cause of the authentication failure.boolean
isCanceled()
boolean
isFailure()
boolean
isSuccess()
void
setAuthed(boolean authed)
Notifies that the session has been authenticated.void
setException(java.lang.Throwable exception)
Sets the exception caught due to connection failure and notifies all threads waiting for this future.-
Methods inherited from interface org.apache.sshd.common.future.SshFuture
addListener, removeListener
-
Methods inherited from interface org.apache.sshd.common.future.VerifiableFuture
verify, verify, verify, verify
-
Methods inherited from interface org.apache.sshd.common.future.WaitableFuture
await, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, getId, isDone
-
-
-
-
Method Detail
-
getException
java.lang.Throwable getException()
Returns the cause of the authentication failure.- Returns:
null
if the authentication operation is not finished yet, or if the connection attempt is successful (useWaitableFuture.isDone()
to distinguish between the two).
-
isSuccess
boolean isSuccess()
- Returns:
true
if 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:
false
if 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.
-
isCanceled
boolean isCanceled()
- Returns:
true
if the connect operation has been canceled bycancel()
method.
-
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
-
setException
void setException(java.lang.Throwable exception)
Sets the exception caught due to connection failure and notifies all threads waiting for this future. This method is invoked by SSHD internally. Please do not call this method directly.- Parameters:
exception
- The caughtThrowable
-
cancel
void cancel()
Cancels the authentication attempt and notifies all threads waiting for this future.
-
-