Interface MamElementFactory


  • public interface MamElementFactory
    Factory that creates MAM objects.
    Since:
    4.5.0
    • Method Detail

      • forParser

        static MamElementFactory forParser​(org.jivesoftware.smack.xml.XmlPullParser parser)
        Creates a new MamElementFactory for the parser based on the namespace of the parser.
        Parameters:
        parser - the XML parser to retrieve the MAM namespace from
        Returns:
        the factory suitable for the MAM namespace
      • newResultExtension

        MamElements.MamResultExtension newResultExtension​(java.lang.String queryId,
                                                          java.lang.String id,
                                                          org.jivesoftware.smackx.forward.packet.Forwarded<org.jivesoftware.smack.packet.Message> forwarded)
        Create a MAM result extension class.
        Parameters:
        queryId - id of the query
        id - the message's archive UID
        forwarded - the original message as it was received
        Returns:
        the result extension
      • newFinIQ

        MamFinIQ newFinIQ​(java.lang.String queryId,
                          org.jivesoftware.smackx.rsm.packet.RSMSet rsmSet,
                          boolean complete,
                          boolean stable)
        Create a MAM fin IQ class.
        Parameters:
        queryId - id of the query
        rsmSet - the RSM set included in the <fin/>
        complete - true if the results returned by the server are complete (no further paging in needed)
        stable - false if the results returned by the sever are unstable (e.g. they might later change in sequence or content)
        Returns:
        the fin IQ
      • newPrefsIQ

        MamPrefsIQ newPrefsIQ​(java.util.List<org.jxmpp.jid.Jid> alwaysJids,
                              java.util.List<org.jxmpp.jid.Jid> neverJids,
                              MamPrefsIQ.DefaultBehavior defaultBehavior)
        Create a new MAM preferences IQ.
        Parameters:
        alwaysJids - JIDs for which all messages are archived by default
        neverJids - JIDs for which messages are never archived
        defaultBehavior - default archive behavior
        Returns:
        the prefs IQ
      • newPrefsIQ

        MamPrefsIQ newPrefsIQ()
        Construct a new MAM <prefs/> IQ retrieval request (IQ type 'get').
        Returns:
        the prefs IQ
      • newQueryIQ

        MamQueryIQ newQueryIQ​(java.lang.String queryId,
                              java.lang.String node,
                              org.jivesoftware.smackx.xdata.packet.DataForm dataForm)
        Create a new MAM Query IQ.
        Parameters:
        queryId - id of the query
        node - pubsub node id when querying a pubsub node, null when not querying a pubsub node
        dataForm - the dataform containing the query parameters
        Returns:
        the query IQ