public final class SendTask<S extends Stanza> extends Object implements Future<Void>
This class implements Future, which Future.isDone() is done}, when the stanza has been sent to the server.
XmppSession.sendMessage(Message)| Modifier and Type | Method and Description |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
Void |
get() |
Void |
get(long timeout,
TimeUnit timeUnit) |
S |
getStanza()
Gets the stanza, which has been sent.
|
boolean |
isCancelled() |
boolean |
isDone() |
void |
onAcknowledge(Consumer<S> onAcknowledge)
Called when the sent stanza has been acknowledged by the server.
|
void |
onFailed(BiConsumer<Throwable,S> onFailure)
Called, when a send operation failed.
|
void |
onSent(Consumer<S> onSent)
Called, when a stanza has been sent to the server.
|
public final S getStanza()
public final void onAcknowledge(Consumer<S> onAcknowledge)
onAcknowledge - The consumer.public final void onSent(Consumer<S> onSent)
onSent - The callback.public final void onFailed(BiConsumer<Throwable,S> onFailure)
onFailure - The callback.public final boolean cancel(boolean mayInterruptIfRunning)
public final boolean isCancelled()
isCancelled in interface Future<Void>public final Void get() throws InterruptedException, ExecutionException
get in interface Future<Void>InterruptedExceptionExecutionExceptionpublic final Void get(long timeout, TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException
get in interface Future<Void>InterruptedExceptionExecutionExceptionTimeoutExceptionCopyright © 2014–2016 XMPP.rocks. All rights reserved.