public class DefaultAuthFuture extends DefaultVerifiableSshFuture<AuthFuture> implements AuthFuture
AuthFuture
.CANCELED
log
Constructor and Description |
---|
DefaultAuthFuture(Object id,
Object lock) |
Modifier and Type | Method and Description |
---|---|
Throwable |
getException()
Returns the cause of the authentication failure.
|
boolean |
isFailure() |
boolean |
isSuccess() |
void |
setAuthed(boolean authed)
Notifies that the session has been authenticated.
|
void |
setException(Throwable exception)
Sets the exception caught due to connection failure and notifies all threads waiting for this future.
|
AuthFuture |
verify(long timeoutMillis)
Wait and verify that the operation was successful
|
addListener, await0, cancel, getNumRegisteredListeners, getValue, isCanceled, isDone, notifyListeners, removeListener, setValue, toString
asListener, asT, await, awaitUninterruptibly, formatExceptionMessage, getId, notifyListener, verifyResult
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
cancel, isCanceled
addListener, removeListener
await, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, getId, isDone
verify, verify, verify
public AuthFuture verify(long timeoutMillis) throws IOException
VerifiableFuture
verify
in interface VerifiableFuture<AuthFuture>
timeoutMillis
- Wait timeout in millisecondsIOException
- If failed to verify successfully on timepublic Throwable getException()
AuthFuture
getException
in interface AuthFuture
null
if the authentication operation is not finished yet, or if the connection attempt is
successful (use WaitableFuture.isDone()
to distinguish between the two).public boolean isSuccess()
isSuccess
in interface AuthFuture
true
if the authentication operation is finished successfully. Note: calling this
method while the operation is in progress returns false
. Should check WaitableFuture.isDone()
in order
to ensure that the result is valid.public boolean isFailure()
isFailure
in interface AuthFuture
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 check WaitableFuture.isDone()
in order to ensure that the result is valid.public void setAuthed(boolean authed)
AuthFuture
setAuthed
in interface AuthFuture
authed
- Authentication success statepublic void setException(Throwable exception)
AuthFuture
setException
in interface AuthFuture
exception
- The caught Throwable
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.