Package org.apache.sshd.client.future
Interface OpenFuture
- All Superinterfaces:
SshFuture<OpenFuture>,VerifiableFuture<OpenFuture>,WaitableFuture
- All Known Implementing Classes:
DefaultOpenFuture
An
SshFuture for asynchronous channel opening requests.-
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancels the connection attempt and notifies all threads waiting for this future.Returns the cause of the connection failure.booleanbooleanisOpened()voidsetException(Throwable exception) Sets the exception caught due to connection failure and notifies all threads waiting for this future.voidSets the newly connected session and notifies all threads waiting for this future.Methods inherited from interface org.apache.sshd.common.future.SshFuture
addListener, removeListenerMethods inherited from interface org.apache.sshd.common.future.VerifiableFuture
verify, verify, verify, verifyMethods inherited from interface org.apache.sshd.common.future.WaitableFuture
await, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, getId, isDone
-
Method Details
-
getException
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).
-
isOpened
boolean isOpened()- Returns:
trueif the connect operation is finished successfully.
-
isCanceled
boolean isCanceled()- Returns:
trueif the connect operation has been canceled bycancel()method.
-
setOpened
void setOpened()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. -
setException
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.
-