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.
|
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(String node,
DataForm dataForm,
RSMSet rsmSet)
Returns a page of the archive.
|
MamManager.MamQueryResult |
pageAfter(org.jxmpp.jid.Jid chatJid,
String messageUid,
int max)
Obtain page after the last message saved (specific chat).
|
MamManager.MamQueryResult |
pageBefore(org.jxmpp.jid.Jid chatJid,
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(Date start,
Date end)
Query archive filtering by start and/or end date.
|
MamManager.MamQueryResult |
queryArchive(Integer max)
Query archive with a maximum amount of results.
|
MamManager.MamQueryResult |
queryArchive(Integer max,
Date start,
Date end,
org.jxmpp.jid.Jid withJid,
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(List<FormField> additionalFields)
Query Archive adding filters with additional fields.
|
MamManager.MamQueryResult |
queryArchive(String node,
Integer max,
Date start,
Date end,
org.jxmpp.jid.Jid withJid,
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(Date end)
Query archive filtering by end date.
|
MamManager.MamQueryResult |
queryArchiveWithStartDate(Date start)
Query archive filtering by start date.
|
MamManager.MamPrefsResult |
retrieveArchivingPreferences()
Get the preferences stored in the server.
|
List<FormField> |
retrieveFormFields()
Get the form fields supported by the server.
|
List<FormField> |
retrieveFormFields(String node)
Get the form fields supported by the server.
|
MamManager.MamPrefsResult |
updateArchivingPreferences(List<org.jxmpp.jid.Jid> alwaysJids,
List<org.jxmpp.jid.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, org.jxmpp.jid.Jid archiveAddress)
public MamManager.MamQueryResult queryArchive(Integer max) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInException
max
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult queryArchive(org.jxmpp.jid.Jid withJid) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInException
withJid
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult queryArchive(Date start, Date end) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInException
start
- end
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult queryArchive(List<FormField> additionalFields) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInException
additionalFields
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult queryArchiveWithStartDate(Date start) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInException
start
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult queryArchiveWithEndDate(Date end) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInException
end
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult queryArchive(Integer max, Date start, Date end, org.jxmpp.jid.Jid withJid, List<FormField> additionalFields) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInException
max
- start
- end
- withJid
- additionalFields
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult queryArchive(String node, Integer max, Date start, Date end, org.jxmpp.jid.Jid withJid, List<FormField> additionalFields) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInException
node
- The Pubsub node name, can be nullmax
- start
- end
- withJid
- additionalFields
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult page(DataForm dataForm, RSMSet rsmSet) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInException
dataForm
- rsmSet
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult page(String node, DataForm dataForm, RSMSet rsmSet) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInException
node
- The Pubsub node name, can be nulldataForm
- rsmSet
- SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult pageNext(MamManager.MamQueryResult mamQueryResult, int count) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInException
mamQueryResult
- is the previous query resultcount
- is the amount of messages that a page containsSmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult pagePrevious(MamManager.MamQueryResult mamQueryResult, int count) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInException
mamQueryResult
- is the previous query resultcount
- is the amount of messages that a page containsSmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
InterruptedException
SmackException.NotLoggedInException
public MamManager.MamQueryResult pageBefore(org.jxmpp.jid.Jid chatJid, String messageUid, int max) throws XMPPException.XMPPErrorException, SmackException.NotLoggedInException, SmackException.NotConnectedException, 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
InterruptedException
SmackException.NoResponseException
public MamManager.MamQueryResult pageAfter(org.jxmpp.jid.Jid chatJid, String messageUid, int max) throws XMPPException.XMPPErrorException, SmackException.NotLoggedInException, SmackException.NotConnectedException, 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
InterruptedException
SmackException.NoResponseException
public MamManager.MamQueryResult mostRecentPage(org.jxmpp.jid.Jid chatJid, int max) throws XMPPException.XMPPErrorException, SmackException.NotLoggedInException, SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException
chatJid
- max
- XMPPException.XMPPErrorException
SmackException.NotLoggedInException
SmackException.NotConnectedException
InterruptedException
SmackException.NoResponseException
public List<FormField> retrieveFormFields() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInException
SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
InterruptedException
SmackException.NotLoggedInException
public List<FormField> retrieveFormFields(String node) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInException
node
- The Pubsub node name, can be nullSmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
InterruptedException
SmackException.NotLoggedInException
public boolean isSupported() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
false
otherwhise.SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
InterruptedException
@Deprecated public boolean isSupportedByServer() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
SmackException.NotConnectedException
XMPPException.XMPPErrorException
SmackException.NoResponseException
InterruptedException
public MamManager.MamPrefsResult retrieveArchivingPreferences() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInException
SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
InterruptedException
SmackException.NotLoggedInException
public MamManager.MamPrefsResult updateArchivingPreferences(List<org.jxmpp.jid.Jid> alwaysJids, List<org.jxmpp.jid.Jid> neverJids, MamPrefsIQ.DefaultBehavior defaultBehavior) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, 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
InterruptedException
SmackException.NotLoggedInException