public class DefaultAuthFuture extends DefaultVerifiableSshFuture<AuthFuture> implements AuthFuture
AuthFuture
.CANCELED
log
Constructor and Description |
---|
DefaultAuthFuture(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
|
verify, verify
addListener, await0, cancel, getValue, isCanceled, isDone, notifyListeners, removeListener, setValue
asListener, asT, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, notifyListener, verifyResult
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cancel, isCanceled
addListener, removeListener
await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, isDone
verify, verify
public DefaultAuthFuture(Object lock)
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–2016 The Apache Software Foundation. All rights reserved.