Package rocks.xmpp.core.stanza.model.client

Examples of rocks.xmpp.core.stanza.model.client.IQ


                "  <error type='modify'>\n" +
                "    <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>\n" +
                "    <jid-required xmlns='http://jabber.org/protocol/pubsub#errors'/>\n" +
                "  </error>\n" +
                "</iq>\n";
        IQ iq = unmarshal(xml, IQ.class);
        Assert.assertTrue(iq.getError().getExtension() instanceof JidRequired);
    }
View Full Code Here


                "    <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>\n" +
                "    <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'\n" +
                "                 feature='subscription-options'/>\n" +
                "  </error>\n" +
                "</iq>";
        IQ iq = unmarshal(xml, IQ.class);
        Assert.assertTrue(iq.getError().getExtension() instanceof Unsupported);
        Assert.assertEquals(((Unsupported) iq.getError().getExtension()).getFeature(), PubSubFeature.SUBSCRIPTION_OPTIONS);
    }
View Full Code Here

                "  <error type='modify'>\n" +
                "    <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>\n" +
                "    <invalid-options xmlns='http://jabber.org/protocol/pubsub#errors'/>\n" +
                "  </error>\n" +
                "</iq>";
        IQ iq = unmarshal(xml, IQ.class);
        Assert.assertTrue(iq.getError().getExtension() instanceof InvalidOptions);
    }
View Full Code Here

                "    <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>\n" +
                "    <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'\n" +
                "                 feature='retrieve-default-sub'/>\n" +
                "  </error>\n" +
                "</iq>\n";
        IQ iq = unmarshal(xml, IQ.class);
        Assert.assertTrue(iq.getError().getExtension() instanceof Unsupported);
        Assert.assertEquals(((Unsupported) iq.getError().getExtension()).getFeature(), PubSubFeature.RETRIEVE_DEFAULT_SUB);
    }
View Full Code Here

     * @return The vCard.
     * @throws rocks.xmpp.core.stanza.model.StanzaException If the entity returned a stanza error.
     * @throws rocks.xmpp.core.session.NoResponseException  If the entity did not respond.
     */
    public VCard getVCard() throws XmppException {
        IQ result = xmppSession.query(new IQ(IQ.Type.GET, new VCard()));
        return result.getExtension(VCard.class);
    }
View Full Code Here

                "    to='characters.shakespeare.lit'\n" +
                "    id='search1'\n" +
                "    xml:lang='en'>\n" +
                "  <query xmlns='jabber:iq:search'/>\n" +
                "</iq>\n";
        IQ iq = unmarshal(xml, IQ.class);
        Search search = iq.getExtension(Search.class);
        Assert.assertNotNull(search);
    }
View Full Code Here

    public void setVCard(VCard vCard) throws XmppException {
        if (vCard == null) {
            throw new IllegalArgumentException("vCard must not be null.");
        }
        // Update the vCard
        xmppSession.query(new IQ(IQ.Type.SET, vCard));

        // Then inform about the update by sending a presence. The avatar manager will add the update extension.
        AvatarManager avatarManager = xmppSession.getExtensionManager(AvatarManager.class);
        if (isEnabled() && avatarManager.isEnabled()) {
            Presence presence = xmppSession.getPresenceManager().getLastSentPresence();
View Full Code Here

                "    <feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>\n" +
                "    <unsupported xmlns='http://jabber.org/protocol/pubsub#errors'\n" +
                "                 feature='publish'/>\n" +
                "  </error>\n" +
                "</iq>";
        IQ iq = unmarshal(xml, IQ.class);
        Assert.assertTrue(iq.getError().getExtension() instanceof Unsupported);
        Assert.assertEquals(((Unsupported) iq.getError().getExtension()).getFeature(), PubSubFeature.PUBLISH);
    }
View Full Code Here

     * @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

     */
    public VCard getVCard(Jid jid) throws XmppException {
        if (jid == null) {
            throw new IllegalArgumentException("jid must not be null.");
        }
        IQ result = xmppSession.query(new IQ(jid.asBareJid(), IQ.Type.GET, new VCard()));
        return result.getExtension(VCard.class);
    }
View Full Code Here

TOP

Related Classes of rocks.xmpp.core.stanza.model.client.IQ

Copyright © 2018 www.massapicom. 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.