Class DefaultConnectFuture

All Implemented Interfaces:
ConnectFuture, ClientSessionHolder, SshFuture<ConnectFuture>, VerifiableFuture<ConnectFuture>, WaitableFuture, SessionContextHolder, SessionHolder<ClientSession>

public class DefaultConnectFuture extends DefaultVerifiableSshFuture<ConnectFuture> implements ConnectFuture
A default implementation of ConnectFuture.
  • Constructor Details

    • DefaultConnectFuture

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

    • verify

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

      public ClientSession getSession()
      Specified by:
      getSession in interface SessionHolder<ClientSession>
    • getException

      public Throwable getException()
      Description copied from interface: ConnectFuture
      Returns the cause of the connection failure.
      Specified by:
      getException in interface ConnectFuture
      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)
    • isConnected

      public boolean isConnected()
      Specified by:
      isConnected in interface ConnectFuture
      Returns:
      true if the connect operation is finished successfully.
    • setSession

      public void setSession(ClientSession session)
      Description copied from interface: ConnectFuture
      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:
      setSession in interface ConnectFuture
      Parameters:
      session - The ClientSession
    • setException

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