public interface Acknowledgement
| Modifier and Type | Method and Description |
|---|---|
Acknowledgement |
handle(java.util.function.Consumer<Throwable> fn)
Returns a new Acknowledgement that, when the message that was send has been acknowledged is executed.
|
boolean |
isAcknowledged()
Returns whether or not the message has been successfully acknowledge by the remote relay server.
|
boolean |
isDone()
Returns
true if completed in any fashion: normally or exceptionally. |
void |
join()
Returns once the message has been acknowledged, or throws an (unchecked) exception if completed exceptionally.
|
Acknowledgement |
orTimeout(long timeout,
TimeUnit unit)
Creates a new acknowledgement that will time out via
TimeoutException if the message has not been
acknowledgement within the specified timeout. |
Acknowledgement |
thenRun(Runnable runnable)
Returns a new Acknowledgement that, when the message that was send has been successfully acknowledged, executes
the given action.
|
default Acknowledgement |
timeout(long timeout,
TimeUnit unit)
Deprecated.
|
CompletableFuture<Void> |
toCompletableFuture()
Returns a
CompletableFuture maintaining the same completion properties as this acknowledgement. |
Acknowledgement handle(java.util.function.Consumer<Throwable> fn)
CompletionStage documentation for rules covering exceptional completion.fn - the consumer that will invoked before completing the returned Acknowledgement. If the message failed
to be acknowledge the specified throwable is non-nullboolean isAcknowledged()
boolean isDone()
true if completed in any fashion: normally or exceptionally.true if completedvoid join()
CompletionException with the underlying
exception as its cause.CompletionException - if this acknowledgement completed exceptionally or a completion computation threw an exceptionAcknowledgement thenRun(Runnable runnable)
CompletionStage documentation for rules covering exceptional completion.runnable - the action to perform before completing the returned Acknowledgement@Deprecated default Acknowledgement timeout(long timeout, TimeUnit unit)
Acknowledgement orTimeout(long timeout, TimeUnit unit)
TimeoutException if the message has not been
acknowledgement within the specified timeout.timeout - the maximum time to waitunit - the time unit of the timeout argumentCompletableFuture<Void> toCompletableFuture()
CompletableFuture maintaining the same completion properties as this acknowledgement.Copyright © 2012–2015 Danish Maritime Authority. All rights reserved.