Package rocks.xmpp.extensions.offline
Class OfflineMessageManager
- java.lang.Object
-
- rocks.xmpp.extensions.offline.OfflineMessageManager
-
public final class OfflineMessageManager extends Object
This manager covers the use cases of XEP-0013: Flexible Offline Message Retrieval.Offline Message Retrieval must be used before sending initial presence, in order to tell the server, that it must not flood the client with offline messages later.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AsyncResult<Boolean>
isSupported()
Discovers support for flexible offline message retrieval.AsyncResult<IQ>
removeAllMessages()
Removes all offline messages.AsyncResult<IQ>
removeMessages(String... ids)
Removes specific offline messages.AsyncResult<IQ>
requestAllMessages()
Requests all offline messages.AsyncResult<IQ>
requestMessage(String id)
Requests a specific offline message.AsyncResult<List<OfflineMessageHeader>>
requestMessageHeaders()
Gets the offline message headers.AsyncResult<Integer>
requestNumberOfMessages()
Gets the number of offline messages.
-
-
-
Method Detail
-
isSupported
public AsyncResult<Boolean> isSupported()
Discovers support for flexible offline message retrieval.- Returns:
- The async result with true, if the server supports flexible offline message retrieval; otherwise false.
-
requestNumberOfMessages
public AsyncResult<Integer> requestNumberOfMessages()
Gets the number of offline messages.- Returns:
- The async result with the number of offline messages.
- See Also:
- 2.2 Requesting Number of Messages
-
requestMessageHeaders
public AsyncResult<List<OfflineMessageHeader>> requestMessageHeaders()
Gets the offline message headers.- Returns:
- The async result with the list of message headers.
- See Also:
- 2.3 Requesting Message Headers
-
requestMessage
public AsyncResult<IQ> requestMessage(String id)
Requests a specific offline message. The message will be sent in a normal way and contains theOfflineMessage
extension, which can be used to match the idOfflineMessage.getId()
.- Parameters:
id
- The offline message id, which corresponds toOfflineMessageHeader.getId()
- Returns:
- The async result with the server's IQ reply.
- See Also:
- 2.4 Retrieving Specific Messages
-
removeMessages
public AsyncResult<IQ> removeMessages(String... ids)
Removes specific offline messages.- Parameters:
ids
- The offline message ids, which correspond toOfflineMessageHeader.getId()
- Returns:
- The async result with the server's IQ reply.
- See Also:
- 2.5 Removing Specific Messages
-
requestAllMessages
public AsyncResult<IQ> requestAllMessages()
Requests all offline messages.- Returns:
- The async result with the server's IQ reply.
- See Also:
- 2.6 Retrieving All Messages
-
removeAllMessages
public AsyncResult<IQ> removeAllMessages()
Removes all offline messages.- Returns:
- The async result with the server's IQ reply.
- See Also:
- 2.7 Removing All Messages
-
-