Examples of OfflineMessage


Examples of org.jivesoftware.openfire.OfflineMessage

                        Log.error("Error parsing date", e);
                    }
                }
                if ("view".equals(item.attributeValue("action"))) {
                    // User requested to receive specific message
                    OfflineMessage offlineMsg = messageStore.getMessage(from.getNode(), creationDate);
                    if (offlineMsg != null) {
                        sendOfflineMessage(from, offlineMsg);
                    }
                }
                else if ("remove".equals(item.attributeValue("action"))) {
View Full Code Here

Examples of rocks.xmpp.extensions.offline.model.OfflineMessage

     * @throws rocks.xmpp.core.stanza.model.StanzaException If the server returned a stanza error.
     * @throws rocks.xmpp.core.session.NoResponseException  If the server did not respond.
     * @see <a href="http://xmpp.org/extensions/xep-0013.html#retrieve-specific">2.4 Retrieving Specific Messages</a>
     */
    public void requestMessage(String id) throws XmppException {
        xmppSession.query(new IQ(IQ.Type.GET, new OfflineMessage(new OfflineMessage.Item(id, OfflineMessage.Item.Action.VIEW))));
    }
View Full Code Here

Examples of rocks.xmpp.extensions.offline.model.OfflineMessage

    public void removeMessages(String... ids) throws XmppException {
        List<OfflineMessage.Item> items = new ArrayList<>();
        for (String id : ids) {
            items.add(new OfflineMessage.Item(id, OfflineMessage.Item.Action.REMOVE));
        }
        xmppSession.query(new IQ(IQ.Type.SET, new OfflineMessage(items)));
    }
View Full Code Here

Examples of rocks.xmpp.extensions.offline.model.OfflineMessage

     * @throws rocks.xmpp.core.stanza.model.StanzaException If the server returned a stanza error.
     * @throws rocks.xmpp.core.session.NoResponseException  If the server did not respond.
     * @see <a href="http://xmpp.org/extensions/xep-0013.html#retrieve-all">2.6 Retrieving All Messages</a>
     */
    public void requestAllMessages() throws XmppException {
        xmppSession.query(new IQ(IQ.Type.GET, new OfflineMessage(true, false)));
    }
View Full Code Here

Examples of rocks.xmpp.extensions.offline.model.OfflineMessage

     * @throws rocks.xmpp.core.stanza.model.StanzaException If the server returned a stanza error.
     * @throws rocks.xmpp.core.session.NoResponseException  If the server did not respond.
     * @see <a href="http://xmpp.org/extensions/xep-0013.html#remove-all">2.7 Removing All Messages</a>
     */
    public void removeAllMessages() throws XmppException {
        xmppSession.query(new IQ(IQ.Type.SET, new OfflineMessage(false, true)));
    }
View Full Code Here

Examples of rocks.xmpp.extensions.offline.model.OfflineMessage

                "    <item action='view'\n" +
                "          node='2003-02-27T22:52:37.225Z'/>\n" +
                "  </offline>\n" +
                "</iq>";
        IQ iq = unmarshal(xml, IQ.class);
        OfflineMessage offlineMessage = iq.getExtension(OfflineMessage.class);
        Assert.assertNotNull(offlineMessage);
        Assert.assertEquals(offlineMessage.getItems().size(), 1);
    }
View Full Code Here

Examples of rocks.xmpp.extensions.offline.model.OfflineMessage

        Assert.assertEquals(offlineMessage.getItems().size(), 1);
    }

    @Test
    public void marshalOfflineMessagesFetch() throws JAXBException, XMLStreamException {
        String xml = marshal(new OfflineMessage(true, false));
        Assert.assertEquals("<offline xmlns=\"http://jabber.org/protocol/offline\"><fetch></fetch></offline>", xml);
    }
View Full Code Here

Examples of rocks.xmpp.extensions.offline.model.OfflineMessage

        Assert.assertEquals("<offline xmlns=\"http://jabber.org/protocol/offline\"><fetch></fetch></offline>", xml);
    }

    @Test
    public void marshalOfflineMessagesPurge() throws JAXBException, XMLStreamException {
        String xml = marshal(new OfflineMessage(false, true));
        Assert.assertEquals("<offline xmlns=\"http://jabber.org/protocol/offline\"><purge></purge></offline>", xml);
    }
View Full Code Here

Examples of rocks.xmpp.extensions.offline.model.OfflineMessage

        Assert.assertEquals("<offline xmlns=\"http://jabber.org/protocol/offline\"><purge></purge></offline>", xml);
    }

    @Test
    public void marshalOfflineMessagesRetrieval() throws JAXBException, XMLStreamException {
        String xml = marshal(new OfflineMessage(false, true));
        Assert.assertEquals("<offline xmlns=\"http://jabber.org/protocol/offline\"><purge></purge></offline>", xml);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.