public class DefaultConnectFuture extends DefaultVerifiableSshFuture<ConnectFuture> implements ConnectFuture
ConnectFuture
.CANCELED
log
Constructor and Description |
---|
DefaultConnectFuture(Object lock) |
Modifier and Type | Method and Description |
---|---|
Throwable |
getException()
Returns the cause of the connection failure.
|
ClientSession |
getSession() |
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.
|
ConnectFuture |
verify(long timeout)
Wait and verify that the operation was successful
|
verify, verify
addListener, await0, cancel, getValue, isCanceled, isDone, notifyListeners, removeListener, setValue
asListener, asT, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, notifyListener, verifyResult
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cancel, isCanceled
addListener, removeListener
await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, isDone
verify, verify
public DefaultConnectFuture(Object lock)
public ConnectFuture verify(long timeout) throws IOException
VerifiableFuture
verify
in interface VerifiableFuture<ConnectFuture>
timeout
- Wait timeout in millisecondsIOException
- If failed to verify successfully on timepublic ClientSession getSession()
getSession
in interface ConnectFuture
ClientSession
public Throwable getException()
ConnectFuture
getException
in interface ConnectFuture
null
if the connect operation is not finished yet,
or if the connection attempt is successful (use WaitableFuture.isDone()
to
distinguish between the two)public boolean isConnected()
isConnected
in interface ConnectFuture
true
if the connect operation is finished successfully.public void setSession(ClientSession session)
ConnectFuture
setSession
in interface ConnectFuture
session
- The ClientSession
public void setException(Throwable exception)
ConnectFuture
setException
in interface ConnectFuture
exception
- The caught Throwable
Copyright © 2008–2016 The Apache Software Foundation. All rights reserved.