Class EndlessWriteFuture
java.lang.Object
org.apache.sshd.contrib.common.io.EndlessWriteFuture
- All Implemented Interfaces:
HasException,SshFuture<IoWriteFuture>,VerifiableFuture<IoWriteFuture>,WaitableFuture,IoWriteFuture
Never signals a successful write completion and ignores all listeners
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddListener(SshFutureListener<IoWriteFuture> listener) Adds an event listener which is notified when this future is completed.booleanawait(long timeoutMillis, CancelOption... options) Wait for the asynchronous operation to complete with the specified timeout.booleanawaitUninterruptibly(long timeoutMillis, CancelOption... options) Wait for the asynchronous operation to complete with the specified timeout uninterruptibly.Returns the cause of the failure.getId()booleanisDone()booleanremoveListener(SshFutureListener<IoWriteFuture> listener) Removes an existing event listener so it won't be notified when the future is completed.verify(long timeoutMillis, CancelOption... options) Wait and verify that the operation was successfulMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.sshd.common.future.VerifiableFuture
verify, verify, verify, verify, verify, verify, verifyMethods inherited from interface org.apache.sshd.common.future.WaitableFuture
await, await, await, await, await, await, await, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly, awaitUninterruptibly
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
EndlessWriteFuture
public EndlessWriteFuture()
-
-
Method Details
-
verify
Description copied from interface:VerifiableFutureWait and verify that the operation was successful- Specified by:
verifyin interfaceVerifiableFuture<IoWriteFuture>- Parameters:
timeoutMillis- Wait timeout in millisecondsoptions- OptionalCancelOptions defining the behavior on time-out or interrupt; ignored if the future is notCancellable.- Returns:
- The (same) future instance
- Throws:
IOException- If failed to verify successfully on time
-
isDone
public boolean isDone()- Specified by:
isDonein interfaceWaitableFuture- Returns:
trueif the asynchronous operation is completed. Note: it is up to the caller to determine whether it was a successful or failed completion.
-
getId
- Specified by:
getIdin interfaceWaitableFuture- Returns:
- Some identifier useful as
toString()value
-
awaitUninterruptibly
Description copied from interface:WaitableFutureWait for the asynchronous operation to complete with the specified timeout uninterruptibly.- Specified by:
awaitUninterruptiblyin interfaceWaitableFuture- Parameters:
timeoutMillis- Wait time in millisecondsoptions- OptionalCancelOptions defining the behavior on time-out; ignored if the future is notCancellable.- Returns:
trueif the operation is finished.
-
await
Description copied from interface:WaitableFutureWait for the asynchronous operation to complete with the specified timeout.- Specified by:
awaitin interfaceWaitableFuture- Parameters:
timeoutMillis- Wait time in millisecondsoptions- OptionalCancelOptions defining the behavior on time-out or interrupt; ignored if the future is notCancellable.- Returns:
trueif the operation is completed.- Throws:
IOException- if failed - specificallyInterruptedIOExceptionif waiting was interrupted
-
removeListener
Description copied from interface:SshFutureRemoves an existing event listener so it won't be notified when the future is completed.- Specified by:
removeListenerin interfaceSshFuture<IoWriteFuture>- Parameters:
listener- TheSshFutureListenerinstance to remove- Returns:
- The future instance
-
addListener
Description copied from interface:SshFutureAdds an event listener which is notified when this future is completed. If the listener is added after the completion, the listener is directly notified.- Specified by:
addListenerin interfaceSshFuture<IoWriteFuture>- Parameters:
listener- TheSshFutureListenerinstance to add- Returns:
- The future instance
-
isWritten
public boolean isWritten()- Specified by:
isWrittenin interfaceIoWriteFuture- Returns:
- true if the write operation is finished successfully.
-
getException
Description copied from interface:HasExceptionReturns the cause of the failure.- Specified by:
getExceptionin interfaceHasException- Returns:
- the
Throwableof the failure, ornullif not failed (yet).
-