Class DefaultIoConnectFuture

All Implemented Interfaces:
Cancellable, SshFuture<IoConnectFuture>, VerifiableFuture<IoConnectFuture>, WaitableFuture, WithException, IoConnectFuture

public class DefaultIoConnectFuture extends DefaultCancellableSshFuture<IoConnectFuture> implements IoConnectFuture
A default implementation of an IoConnectFuture.
  • Constructor Details

    • DefaultIoConnectFuture

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

    • getSession

      public IoSession getSession()
      Specified by:
      getSession in interface IoConnectFuture
      Returns:
      The current IoSession - may be null if connect operation not finished yet or attempt has failed
      See Also:
    • isConnected

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

      public void setSession(IoSession session)
      Description copied from interface: IoConnectFuture
      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 IoConnectFuture
      Parameters:
      session - The connected IoSession
    • verify

      public IoConnectFuture verify(long timeoutMillis, CancelOption... options) throws IOException
      Description copied from interface: VerifiableFuture
      Wait and verify that the operation was successful
      Specified by:
      verify in interface VerifiableFuture<IoConnectFuture>
      Parameters:
      timeoutMillis - Wait timeout in milliseconds
      options - Optional
      invalid reference
      CancelOptions
      defining the behavior on time-out or interrupt; ignored if the future is not Cancellable.
      Returns:
      The (same) future instance
      Throws:
      IOException - If failed to verify successfully on time