org.apache.sshd.common.future
Interface SshFuture<T extends SshFuture>

All Known Subinterfaces:
AuthFuture, CloseFuture, ConnectFuture, OpenFuture
All Known Implementing Classes:
DefaultAuthFuture, DefaultCloseFuture, DefaultConnectFuture, DefaultOpenFuture, DefaultSshFuture

public interface SshFuture<T extends SshFuture>

Represents the completion of an asynchronous SSH operation on a given object (it may be an SSH session or an SSH channel). Can be listened for completion using a SshFutureListener.

Author:
Apache MINA SSHD Project

Method Summary
 T addListener(SshFutureListener<T> listener)
          Adds an event listener which is notified when this future is completed.
 T await()
          Wait for the asynchronous operation to complete.
 boolean await(long timeoutMillis)
          Wait for the asynchronous operation to complete with the specified timeout.
 boolean await(long timeout, TimeUnit unit)
          Wait for the asynchronous operation to complete with the specified timeout.
 T awaitUninterruptibly()
          Wait for the asynchronous operation to complete uninterruptibly.
 boolean awaitUninterruptibly(long timeoutMillis)
          Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.
 boolean awaitUninterruptibly(long timeout, TimeUnit unit)
          Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.
 boolean isDone()
          Returns if the asynchronous operation is completed.
 T removeListener(SshFutureListener<T> listener)
          Removes an existing event listener so it won't be notified when the future is completed.
 

Method Detail

await

T await()
                          throws InterruptedException
Wait for the asynchronous operation to complete. The attached listeners will be notified when the operation is completed.

Throws:
InterruptedException

await

boolean await(long timeout,
              TimeUnit unit)
              throws InterruptedException
Wait for the asynchronous operation to complete with the specified timeout.

Returns:
true if the operation is completed.
Throws:
InterruptedException

await

boolean await(long timeoutMillis)
              throws InterruptedException
Wait for the asynchronous operation to complete with the specified timeout.

Returns:
true if the operation is completed.
Throws:
InterruptedException

awaitUninterruptibly

T awaitUninterruptibly()
Wait for the asynchronous operation to complete uninterruptibly. The attached listeners will be notified when the operation is completed.

Returns:
the current IoFuture

awaitUninterruptibly

boolean awaitUninterruptibly(long timeout,
                             TimeUnit unit)
Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.

Returns:
true if the operation is completed.

awaitUninterruptibly

boolean awaitUninterruptibly(long timeoutMillis)
Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.

Returns:
true if the operation is finished.

isDone

boolean isDone()
Returns if the asynchronous operation is completed.


addListener

T addListener(SshFutureListener<T> listener)
Adds an event listener which is notified when this future is completed. If the listener is added after the completion, the listener is directly notified.


removeListener

T removeListener(SshFutureListener<T> listener)
Removes an existing event listener so it won't be notified when the future is completed.



Copyright © 2008-2012 Apache Software Foundation. All Rights Reserved.