public interface ConnectFuture extends SshFuture<ConnectFuture>, VerifiableFuture<ConnectFuture>, SessionHolder<ClientSession>, ClientSessionHolder
SshFuture
for asynchronous connections requests.Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the connection attempt and notifies all threads waiting for this future.
|
default ClientSession |
getClientSession() |
Throwable |
getException()
Returns the cause of the connection failure.
|
boolean |
isCanceled() |
boolean |
isConnected() |
void |
setException(Throwable exception)
Sets the exception caught due to connection failure and notifies all threads waiting for this future.
|
void |
setSession(ClientSession session)
Sets the newly connected session and notifies all threads waiting for this future.
|
addListener, removeListener
await, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, getId, isDone
verify, verify, verify, verify
getSession, getSessionContext
default ClientSession getClientSession()
getClientSession
in interface ClientSessionHolder
ClientSession
usedboolean isConnected()
true
if the connect operation is finished successfully.boolean isCanceled()
true
if the connect operation has been canceled by cancel()
method.void setSession(ClientSession session)
session
- The ClientSession
Throwable getException()
null
if the connect operation is not finished yet, or if the connection attempt is successful
(use WaitableFuture.isDone()
to distinguish between the two)void setException(Throwable exception)
exception
- The caught Throwable
void cancel()
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.