public final class MamManager extends Manager
Modifier and Type | Class and Description |
---|---|
static class |
MamManager.MamPrefsResult
MAM preferences result class.
|
static class |
MamManager.MamQueryResult
MAM query result class.
|
Modifier and Type | Method and Description |
---|---|
static MamManager |
getInstanceFor(XMPPConnection connection)
Get the singleton instance of MamManager.
|
static MamManager |
getInstanceFor(XMPPConnection connection,
Jid archiveAddress) |
boolean |
isSupported()
Check if MAM is supported for the XMPP connection managed by this MamManager.
|
boolean |
isSupportedByServer()
Deprecated.
|
MamManager.MamQueryResult |
mostRecentPage(Jid chatJid,
int max)
Obtain the most recent page of a chat.
|
MamManager.MamQueryResult |
page(DataForm dataForm,
RSMSet rsmSet)
Returns a page of the archive.
|
MamManager.MamQueryResult |
page(java.lang.String node,
DataForm dataForm,
RSMSet rsmSet)
Returns a page of the archive.
|
MamManager.MamQueryResult |
pageAfter(Jid chatJid,
java.lang.String messageUid,
int max)
Obtain page after the last message saved (specific chat).
|
MamManager.MamQueryResult |
pageBefore(Jid chatJid,
java.lang.String messageUid,
int max)
Obtain page before the first message saved (specific chat).
|
MamManager.MamQueryResult |
pageNext(MamManager.MamQueryResult mamQueryResult,
int count)
Returns the next page of the archive.
|
MamManager.MamQueryResult |
pagePrevious(MamManager.MamQueryResult mamQueryResult,
int count)
Returns the previous page of the archive.
|
MamManager.MamQueryResult |
queryArchive(java.util.Date start,
java.util.Date end)
Query archive filtering by start and/or end date.
|
MamManager.MamQueryResult |
queryArchive(java.lang.Integer max)
Query archive with a maximum amount of results.
|
MamManager.MamQueryResult |
queryArchive(java.lang.Integer max,
java.util.Date start,
java.util.Date end,
Jid withJid,
java.util.List<FormField> additionalFields)
Query archive applying filters: max count, start date, end date, from/to
JID and with additional fields.
|
MamManager.MamQueryResult |
queryArchive(Jid withJid)
Query archive with a JID (only messages from/to the JID).
|
MamManager.MamQueryResult |
queryArchive(java.util.List<FormField> additionalFields)
Query Archive adding filters with additional fields.
|
MamManager.MamQueryResult |
queryArchive(java.lang.String node,
java.lang.Integer max,
java.util.Date start,
java.util.Date end,
Jid withJid,
java.util.List<FormField> additionalFields)
Query an message archive like a MUC archive or a pubsub node archive, addressed by an archiveAddress, applying
filters: max count, start date, end date, from/to JID and with additional fields.
|
MamManager.MamQueryResult |
queryArchiveWithEndDate(java.util.Date end)
Query archive filtering by end date.
|
MamManager.MamQueryResult |
queryArchiveWithStartDate(java.util.Date start)
Query archive filtering by start date.
|
MamManager.MamPrefsResult |
retrieveArchivingPreferences()
Get the preferences stored in the server.
|
java.util.List<FormField> |
retrieveFormFields()
Get the form fields supported by the server.
|
java.util.List<FormField> |
retrieveFormFields(java.lang.String node)
Get the form fields supported by the server.
|
MamManager.MamPrefsResult |
updateArchivingPreferences(java.util.List<Jid> alwaysJids,
java.util.List<Jid> neverJids,
MamPrefsIQ.DefaultBehavior defaultBehavior)
Update the preferences in the server.
|
connection, getAuthenticatedConnectionOrThrow
public static MamManager getInstanceFor(XMPPConnection connection)
connection
- public static MamManager getInstanceFor(XMPPConnection connection, Jid archiveAddress)
public MamManager.MamQueryResult queryArchive(java.lang.Integer max) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
max
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult queryArchive(Jid withJid) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
withJid
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult queryArchive(java.util.Date start, java.util.Date end) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
start
- end
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult queryArchive(java.util.List<FormField> additionalFields) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
additionalFields
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult queryArchiveWithStartDate(java.util.Date start) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
start
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult queryArchiveWithEndDate(java.util.Date end) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
end
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult queryArchive(java.lang.Integer max, java.util.Date start, java.util.Date end, Jid withJid, java.util.List<FormField> additionalFields) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
max
- start
- end
- withJid
- additionalFields
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult queryArchive(java.lang.String node, java.lang.Integer max, java.util.Date start, java.util.Date end, Jid withJid, java.util.List<FormField> additionalFields) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
node
- The Pubsub node name, can be nullmax
- start
- end
- withJid
- additionalFields
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult page(DataForm dataForm, RSMSet rsmSet) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
dataForm
- rsmSet
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult page(java.lang.String node, DataForm dataForm, RSMSet rsmSet) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
node
- The Pubsub node name, can be nulldataForm
- rsmSet
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult pageNext(MamManager.MamQueryResult mamQueryResult, int count) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
mamQueryResult
- is the previous query resultcount
- is the amount of messages that a page containsSmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult pagePrevious(MamManager.MamQueryResult mamQueryResult, int count) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
mamQueryResult
- is the previous query resultcount
- is the amount of messages that a page containsSmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult pageBefore(Jid chatJid, java.lang.String messageUid, int max) throws XMPPException.XMPPErrorException, SmackException.NotLoggedInException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NoResponseException
Note that the messageUid is the XEP-0313 UID and not> the stanza ID of the message.
chatJid
- messageUid
- the UID of the message of which messages before should be received.max
- XMPPException.XMPPErrorException
SmackException.NotLoggedInException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NoResponseException
public MamManager.MamQueryResult pageAfter(Jid chatJid, java.lang.String messageUid, int max) throws XMPPException.XMPPErrorException, SmackException.NotLoggedInException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NoResponseException
Note that the messageUid is the XEP-0313 UID and not> the stanza ID of the message.
chatJid
- messageUid
- the UID of the message of which messages after should be received.max
- XMPPException.XMPPErrorException
SmackException.NotLoggedInException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NoResponseException
public MamManager.MamQueryResult mostRecentPage(Jid chatJid, int max) throws XMPPException.XMPPErrorException, SmackException.NotLoggedInException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NoResponseException
chatJid
- max
- XMPPException.XMPPErrorException
SmackException.NotLoggedInException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NoResponseException
public java.util.List<FormField> retrieveFormFields() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NotLoggedInException
public java.util.List<FormField> retrieveFormFields(java.lang.String node) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
node
- The Pubsub node name, can be nullSmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NotLoggedInException
public boolean isSupported() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
false
otherwhise.SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
@Deprecated public boolean isSupportedByServer() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
SmackException.NotConnectedException
XMPPException.XMPPErrorException
SmackException.NoResponseException
java.lang.InterruptedException
public MamManager.MamPrefsResult retrieveArchivingPreferences() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NotLoggedInException
public MamManager.MamPrefsResult updateArchivingPreferences(java.util.List<Jid> alwaysJids, java.util.List<Jid> neverJids, MamPrefsIQ.DefaultBehavior defaultBehavior) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
alwaysJids
- is the list of JIDs that should always have messages to/from
archived in the user's storeneverJids
- is the list of JIDs that should never have messages to/from
archived in the user's storedefaultBehavior
- can be "roster", "always", "never" (see XEP-0313)SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
SmackException.NotLoggedInException