Search in sources :

Example 11 with RSMSet

use of org.jivesoftware.smackx.rsm.packet.RSMSet in project Smack by igniterealtime.

the class MamManager method pagePrevious.

/**
     * Returns the previous page of the archive.
     * 
     * @param mamQueryResult
     *            is the previous query result
     * @param count
     *            is the amount of messages that a page contains
     * @return the MAM query result
     * @throws NoResponseException
     * @throws XMPPErrorException
     * @throws NotConnectedException
     * @throws InterruptedException
     * @throws NotLoggedInException
     */
public MamQueryResult pagePrevious(MamQueryResult mamQueryResult, int count) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException, NotLoggedInException {
    RSMSet previousResultRsmSet = mamQueryResult.mamFin.getRSMSet();
    RSMSet requestRsmSet = new RSMSet(count, previousResultRsmSet.getFirst(), RSMSet.PageDirection.before);
    return page(mamQueryResult, requestRsmSet);
}
Also used : RSMSet(org.jivesoftware.smackx.rsm.packet.RSMSet)

Aggregations

RSMSet (org.jivesoftware.smackx.rsm.packet.RSMSet)11 DataForm (org.jivesoftware.smackx.xdata.packet.DataForm)3 Test (org.junit.Test)3 ExtensionElement (org.jivesoftware.smack.packet.ExtensionElement)2 MamFinIQ (org.jivesoftware.smackx.mam.element.MamFinIQ)2 LinkedList (java.util.LinkedList)1 IQ (org.jivesoftware.smack.packet.IQ)1 MamQueryIQ (org.jivesoftware.smackx.mam.element.MamQueryIQ)1 MamFinIQProvider (org.jivesoftware.smackx.mam.provider.MamFinIQProvider)1 XmlPullParser (org.xmlpull.v1.XmlPullParser)1