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,
org.jxmpp.jid.Jid archiveAddress) |
boolean |
isSupported()
Check if MAM is supported for the XMPP connection managed by this MamManager.
|
boolean |
isSupportedByServer()
Deprecated.
use
isSupported() instead. |
MamManager.MamQueryResult |
mostRecentPage(org.jxmpp.jid.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(org.jxmpp.jid.Jid chatJid,
java.lang.String messageUid,
int max)
Obtain page after the last message saved (specific chat).
|
MamManager.MamQueryResult |
pageBefore(org.jxmpp.jid.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,
org.jxmpp.jid.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(org.jxmpp.jid.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,
org.jxmpp.jid.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<org.jxmpp.jid.Jid> alwaysJids,
java.util.List<org.jxmpp.jid.Jid> neverJids,
MamPrefsIQ.DefaultBehavior defaultBehavior)
Update the preferences in the server.
|
connection, getAuthenticatedConnectionOrThrow, schedulepublic static MamManager getInstanceFor(XMPPConnection connection)
connection - public static MamManager getInstanceFor(XMPPConnection connection, org.jxmpp.jid.Jid archiveAddress)
public MamManager.MamQueryResult queryArchive(java.lang.Integer max) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
max - SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NotLoggedInExceptionpublic MamManager.MamQueryResult queryArchive(org.jxmpp.jid.Jid withJid) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
withJid - SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NotLoggedInExceptionpublic 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.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NotLoggedInExceptionpublic MamManager.MamQueryResult queryArchive(java.util.List<FormField> additionalFields) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
additionalFields - SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NotLoggedInExceptionpublic MamManager.MamQueryResult queryArchiveWithStartDate(java.util.Date start) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
start - SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NotLoggedInExceptionpublic MamManager.MamQueryResult queryArchiveWithEndDate(java.util.Date end) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
end - SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NotLoggedInExceptionpublic MamManager.MamQueryResult queryArchive(java.lang.Integer max, java.util.Date start, java.util.Date end, org.jxmpp.jid.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.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NotLoggedInExceptionpublic MamManager.MamQueryResult queryArchive(java.lang.String node, java.lang.Integer max, java.util.Date start, java.util.Date end, org.jxmpp.jid.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.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NotLoggedInExceptionpublic MamManager.MamQueryResult page(DataForm dataForm, RSMSet rsmSet) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
dataForm - rsmSet - SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NotLoggedInExceptionpublic 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.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NotLoggedInExceptionpublic 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.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NotLoggedInExceptionpublic 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.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NotLoggedInExceptionpublic MamManager.MamQueryResult pageBefore(org.jxmpp.jid.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.XMPPErrorExceptionSmackException.NotLoggedInExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NoResponseExceptionpublic MamManager.MamQueryResult pageAfter(org.jxmpp.jid.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.XMPPErrorExceptionSmackException.NotLoggedInExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NoResponseExceptionpublic MamManager.MamQueryResult mostRecentPage(org.jxmpp.jid.Jid chatJid, int max) throws XMPPException.XMPPErrorException, SmackException.NotLoggedInException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NoResponseException
chatJid - max - XMPPException.XMPPErrorExceptionSmackException.NotLoggedInExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NoResponseExceptionpublic java.util.List<FormField> retrieveFormFields() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NotLoggedInExceptionpublic 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.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NotLoggedInExceptionpublic boolean isSupported() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
falseotherwhise.SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedException@Deprecated public boolean isSupportedByServer() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
isSupported() instead.SmackException.NotConnectedExceptionXMPPException.XMPPErrorExceptionSmackException.NoResponseExceptionjava.lang.InterruptedExceptionpublic MamManager.MamPrefsResult retrieveArchivingPreferences() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NotLoggedInException
SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NotLoggedInExceptionpublic MamManager.MamPrefsResult updateArchivingPreferences(java.util.List<org.jxmpp.jid.Jid> alwaysJids, java.util.List<org.jxmpp.jid.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.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NotLoggedInException