Package org.apache.sshd.client.future
Interface ConnectFuture
-
- All Superinterfaces:
ClientSessionHolder,SessionContextHolder,SessionHolder<ClientSession>,SshFuture<ConnectFuture>,VerifiableFuture<ConnectFuture>,WaitableFuture
- All Known Implementing Classes:
DefaultConnectFuture
public interface ConnectFuture extends SshFuture<ConnectFuture>, VerifiableFuture<ConnectFuture>, SessionHolder<ClientSession>, ClientSessionHolder
AnSshFuturefor asynchronous connections requests.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidcancel()Cancels the connection attempt and notifies all threads waiting for this future.default ClientSessiongetClientSession()java.lang.ThrowablegetException()Returns the cause of the connection failure.booleanisCanceled()booleanisConnected()voidsetException(java.lang.Throwable exception)Sets the exception caught due to connection failure and notifies all threads waiting for this future.voidsetSession(ClientSession session)Sets the newly connected session and notifies all threads waiting for this future.-
Methods inherited from interface org.apache.sshd.common.session.SessionHolder
getSession, getSessionContext
-
Methods inherited from interface org.apache.sshd.common.future.SshFuture
addListener, removeListener
-
Methods inherited from interface org.apache.sshd.common.future.VerifiableFuture
verify, verify, verify, verify
-
Methods inherited from interface org.apache.sshd.common.future.WaitableFuture
await, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, getId, isDone
-
-
-
-
Method Detail
-
getClientSession
default ClientSession getClientSession()
- Specified by:
getClientSessionin interfaceClientSessionHolder- Returns:
- The underlying
ClientSessionused
-
isConnected
boolean isConnected()
- Returns:
trueif the connect operation is finished successfully.
-
isCanceled
boolean isCanceled()
- Returns:
trueif the connect operation has been canceled bycancel()method.
-
setSession
void setSession(ClientSession session)
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.- Parameters:
session- TheClientSession
-
getException
java.lang.Throwable getException()
Returns the cause of the connection failure.- Returns:
nullif the connect operation is not finished yet, or if the connection attempt is successful (useWaitableFuture.isDone()to distinguish between the two)
-
setException
void setException(java.lang.Throwable exception)
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.- Parameters:
exception- The caughtThrowable
-
cancel
void cancel()
Cancels the connection attempt and notifies all threads waiting for this future.
-
-