/** * Returns a page of the archive. * * @param dataForm * @param rsmSet * @return the MAM query result * @throws NoResponseException * @throws XMPPErrorException * @throws NotConnectedException * @throws InterruptedException * @throws NotLoggedInException * @deprecated use {@link #queryArchive(MamQueryArgs)} instead. */ @Deprecated // TODO Remove in Smack 4.4 public MamQueryResult page(DataForm dataForm, RSMSet rsmSet) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException, NotLoggedInException { return page(null, dataForm, rsmSet); }
private MamQueryResult page(MamQueryResult mamQueryResult, RSMSet requestRsmSet) throws NoResponseException, XMPPErrorException, NotConnectedException, NotLoggedInException, InterruptedException { ensureMamQueryResultMatchesThisManager(mamQueryResult); return page(mamQueryResult.node, mamQueryResult.form, requestRsmSet); }
/** * Obtain page after the last message saved (specific chat). * <p> * Note that the messageUid is the XEP-0313 UID and <b>not</b> the stanza ID of the message. * </p> * * @param chatJid * @param messageUid the UID of the message of which messages after should be received. * @param max * @return the MAM query result * @throws XMPPErrorException * @throws NotLoggedInException * @throws NotConnectedException * @throws InterruptedException * @throws NoResponseException * @deprecated use {@link #queryArchive(MamQueryArgs)} instead. */ @Deprecated // TODO Remove in Smack 4.4 public MamQueryResult pageAfter(Jid chatJid, String messageUid, int max) throws XMPPErrorException, NotLoggedInException, NotConnectedException, InterruptedException, NoResponseException { RSMSet rsmSet = new RSMSet(messageUid, null, -1, -1, null, max, null, -1); DataForm dataForm = getNewMamForm(); addWithJid(chatJid, dataForm); return page(null, dataForm, rsmSet); }
/** * Returns the next 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 * @deprecated use {@link MamQuery#pageNext(int)} instead. */ @Deprecated // TODO Remove in Smack 4.4 public MamQueryResult pageNext(MamQueryResult mamQueryResult, int count) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException, NotLoggedInException { RSMSet previousResultRsmSet = mamQueryResult.mamFin.getRSMSet(); RSMSet requestRsmSet = new RSMSet(count, previousResultRsmSet.getLast(), RSMSet.PageDirection.after); return page(mamQueryResult, requestRsmSet); }
/** * 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 * @deprecated use {@link MamQuery#pagePrevious(int)} instead. */ @Deprecated // TODO Remove in Smack 4.4 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); }
/** * Obtain page before the first message saved (specific chat). * <p> * Note that the messageUid is the XEP-0313 UID and <b>not</b> the stanza ID of the message. * </p> * * @param chatJid * @param messageUid the UID of the message of which messages before should be received. * @param max * @return the MAM query result * @throws XMPPErrorException * @throws NotLoggedInException * @throws NotConnectedException * @throws InterruptedException * @throws NoResponseException * @deprecated use {@link #queryArchive(MamQueryArgs)} instead. */ @Deprecated // TODO Remove in Smack 4.4 public MamQueryResult pageBefore(Jid chatJid, String messageUid, int max) throws XMPPErrorException, NotLoggedInException, NotConnectedException, InterruptedException, NoResponseException { RSMSet rsmSet = new RSMSet(null, messageUid, -1, -1, null, max, null, -1); DataForm dataForm = getNewMamForm(); addWithJid(chatJid, dataForm); return page(null, dataForm, rsmSet); }