Class DefaultAuthFuture

All Implemented Interfaces:
AuthFuture, SshFuture<AuthFuture>, VerifiableFuture<AuthFuture>, WaitableFuture

public class DefaultAuthFuture extends DefaultVerifiableSshFuture<AuthFuture> implements AuthFuture
A default implementation of AuthFuture.
  • Constructor Details

    • DefaultAuthFuture

      public DefaultAuthFuture(Object id, Object lock)
  • Method Details

    • verify

      public AuthFuture verify(long timeoutMillis) throws IOException
      Description copied from interface: VerifiableFuture
      Wait and verify that the operation was successful
      Specified by:
      verify in interface VerifiableFuture<AuthFuture>
      Parameters:
      timeoutMillis - Wait timeout in milliseconds
      Returns:
      The (same) future instance
      Throws:
      IOException - If failed to verify successfully on time
    • getException

      public Throwable getException()
      Description copied from interface: AuthFuture
      Returns the cause of the authentication failure.
      Specified by:
      getException in interface AuthFuture
      Returns:
      null if the authentication operation is not finished yet, or if the connection attempt is successful (use WaitableFuture.isDone() to distinguish between the two).
    • isSuccess

      public boolean isSuccess()
      Specified by:
      isSuccess in interface AuthFuture
      Returns:
      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.
    • isFailure

      public boolean isFailure()
      Specified by:
      isFailure in interface AuthFuture
      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 check WaitableFuture.isDone() in order to ensure that the result is valid.
    • setAuthed

      public void setAuthed(boolean authed)
      Description copied from interface: AuthFuture
      Notifies that the session has been authenticated. This method is invoked by SSHD internally. Please do not call this method directly.
      Specified by:
      setAuthed in interface AuthFuture
      Parameters:
      authed - Authentication success state
    • setException

      public void setException(Throwable exception)
      Description copied from interface: AuthFuture
      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.
      Specified by:
      setException in interface AuthFuture
      Parameters:
      exception - The caught Throwable