Class DefaultOpenFuture

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

public class DefaultOpenFuture extends DefaultVerifiableSshFuture<OpenFuture> implements OpenFuture
A default implementation of OpenFuture.
  • Constructor Details

    • DefaultOpenFuture

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

    • verify

      public OpenFuture verify(long timeoutMillis) throws IOException
      Description copied from interface: VerifiableFuture
      Wait and verify that the operation was successful
      Specified by:
      verify in interface VerifiableFuture<OpenFuture>
      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: OpenFuture
      Returns the cause of the connection failure.
      Specified by:
      getException in interface OpenFuture
      Returns:
      null if the connect operation is not finished yet, or if the connection attempt is successful (use WaitableFuture.isDone() to distinguish between the two).
    • isOpened

      public boolean isOpened()
      Specified by:
      isOpened in interface OpenFuture
      Returns:
      true if the connect operation is finished successfully.
    • setOpened

      public void setOpened()
      Description copied from interface: OpenFuture
      Sets the newly connected session and notifies all threads waiting for this future. This method is invoked by SSHD internally. Please do not call this method directly.
      Specified by:
      setOpened in interface OpenFuture
    • setException

      public void setException(Throwable exception)
      Description copied from interface: OpenFuture
      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 OpenFuture
      Parameters:
      exception - The caught Throwable