Package org.apache.sshd.common.future
Interface VerifiableFuture<T>
-
- Type Parameters:
T- Type of verification result
- All Known Subinterfaces:
AuthFuture,CancelFuture,ConnectFuture,IoReadFuture,IoWriteFuture,KeyExchangeFuture,OpenFuture
- All Known Implementing Classes:
AbstractIoWriteFuture,ChannelAsyncInputStream.IoReadFutureImpl,ChannelAsyncOutputStream.BufferedFuture,DefaultAuthFuture,DefaultCancelFuture,DefaultCancellableSshFuture,DefaultConnectFuture,DefaultIoConnectFuture,DefaultKeyExchangeFuture,DefaultOpenFuture,DefaultVerifiableSshFuture,IoWriteFutureImpl,Nio2DefaultIoWriteFuture,PendingWriteFuture,SimpleIoOutputStream.DefaultIoWriteFuture
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface VerifiableFuture<T>Represents an asynchronous operation whose successful result can be verified somehow. The contract guarantees that if theverifyXXXmethod returns without an exception then the operation was completed successfully
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Tverify()WaitLong.MAX_VALUEmsec.default Tverify(long timeoutMillis)Wait and verify that the operation was successfuldefault Tverify(long timeout, java.util.concurrent.TimeUnit unit)Wait and verify that the operation was successfuldefault Tverify(long timeout, java.util.concurrent.TimeUnit unit, CancelOption... options)Wait and verify that the operation was successfulTverify(long timeoutMillis, CancelOption... options)Wait and verify that the operation was successfuldefault Tverify(java.time.Duration timeout)Wait and verify that the operation was successfuldefault Tverify(java.time.Duration timeout, CancelOption... options)Wait and verify that the operation was successfuldefault Tverify(CancelOption... options)WaitLong.MAX_VALUEmsec.
-
-
-
Method Detail
-
verify
default T verify() throws java.io.IOException
WaitLong.MAX_VALUEmsec. and verify that the operation was successful- Returns:
- The (same) future instance
- Throws:
java.io.IOException- If failed to verify successfully on time- See Also:
verify(long, CancelOption[])
-
verify
default T verify(CancelOption... options) throws java.io.IOException
WaitLong.MAX_VALUEmsec. and verify that the operation was successful- Parameters:
options- OptionalCancelOptions defining the behavior on time-out or interrupt; ignored if the future is notCancellable.- Returns:
- The (same) future instance
- Throws:
java.io.IOException- If failed to verify successfully on time- See Also:
verify(long, CancelOption[])
-
verify
default T verify(long timeout, java.util.concurrent.TimeUnit unit) throws java.io.IOException
Wait and verify that the operation was successful- Parameters:
timeout- The number of time units to waitunit- The waitTimeUnit- Returns:
- The (same) future instance
- Throws:
java.io.IOException- If failed to verify successfully on time- See Also:
verify(long, CancelOption[])
-
verify
default T verify(long timeout, java.util.concurrent.TimeUnit unit, CancelOption... options) throws java.io.IOException
Wait and verify that the operation was successful- Parameters:
timeout- The number of time units to waitunit- The waitTimeUnitoptions- OptionalCancelOptions defining the behavior on time-out or interrupt; ignored if the future is notCancellable.- Returns:
- The (same) future instance
- Throws:
java.io.IOException- If failed to verify successfully on time- See Also:
verify(long, CancelOption[])
-
verify
default T verify(java.time.Duration timeout) throws java.io.IOException
Wait and verify that the operation was successful- Parameters:
timeout- The maximum duration to wait,nullto wait forever- Returns:
- The (same) future instance
- Throws:
java.io.IOException- If failed to verify successfully on time- See Also:
verify(long, CancelOption[])
-
verify
default T verify(java.time.Duration timeout, CancelOption... options) throws java.io.IOException
Wait and verify that the operation was successful- Parameters:
timeout- The maximum duration to wait,nullto wait foreveroptions- OptionalCancelOptions defining the behavior on time-out or interrupt; ignored if the future is notCancellable.- Returns:
- The (same) future instance
- Throws:
java.io.IOException- If failed to verify successfully on time- See Also:
verify(long, CancelOption[])
-
verify
default T verify(long timeoutMillis) throws java.io.IOException
Wait and verify that the operation was successful- Parameters:
timeoutMillis- Wait timeout in milliseconds- Returns:
- The (same) future instance
- Throws:
java.io.IOException- If failed to verify successfully on time
-
verify
T verify(long timeoutMillis, CancelOption... options) throws java.io.IOException
Wait and verify that the operation was successful- 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:
java.io.IOException- If failed to verify successfully on time
-
-