Package org.apache.vysper.xmpp.stanza

Examples of org.apache.vysper.xmpp.stanza.StanzaBuilder.endInnerElement()


        stanzaBuilder.startInnerElement("event", NamespaceURIs.XEP0060_PUBSUB_EVENT);
        stanzaBuilder.startInnerElement("items", NamespaceURIs.XEP0060_PUBSUB_EVENT);
        stanzaBuilder.addAttribute("node", nodeName);
        stanzaBuilder.addPreparedElement(item);
        stanzaBuilder.endInnerElement(); // items
        stanzaBuilder.endInnerElement(); // event
        return stanzaBuilder.build();
    }

}
View Full Code Here


        List<SubscriptionItem> subscriptions = collectSubscriptions(root, sender, nodeName);

        buildSuccessStanza(sb, nodeName, subscriptions);

        sb.endInnerElement(); // pubsub
        return new IQStanza(sb.build());
    }

    /**
     * Traverses through all nodes or a single node to collect all subscriptions of the user.
View Full Code Here

            throws ProtocolException {
        StanzaBuilder stanzaBuilder = StanzaBuilder.createIQStanza(from, to, type, id);

        stanzaBuilder.startInnerElement("query", namespaceUri);
        stanzaBuilder.addPreparedElement(item);
        stanzaBuilder.endInnerElement();

        Stanza iqStanza = stanzaBuilder.build();
        ResponseStanzaContainer container = handler.execute(iqStanza, sessionContext.getServerRuntimeContext(), true,
                sessionContext, null);
        if (container != null) {
View Full Code Here

    private Stanza changeNick(Entity occupantJid, Entity roomWithNickJid) throws ProtocolException {
        StanzaBuilder stanzaBuilder = StanzaBuilder.createPresenceStanza(occupantJid, roomWithNickJid, null, null,
                null, null);
        stanzaBuilder.startInnerElement("x", NamespaceURIs.XEP0045_MUC);

        stanzaBuilder.endInnerElement();
        Stanza presenceStanza = stanzaBuilder.build();
        ResponseStanzaContainer container = handler.execute(presenceStanza, sessionContext.getServerRuntimeContext(),
                true, sessionContext, null);
        if (container != null) {
            return container.getResponseStanza();
View Full Code Here

        }

        List<AffiliationItem> affiliations = collectAllAffiliations(node);
        buildSuccessStanza(sb, node, affiliations);

        sb.endInnerElement();
        return new IQStanza(sb.build());
    }

    /**
     * This method takes care of handling the "affiliations" use-case including all (relevant) error conditions.
View Full Code Here

            return errorStanzaGenerator.generateNotAcceptableErrorStanza(serverJID, sender, stanza);
        } catch (Throwable t) { // possible null-pointer
            return errorStanzaGenerator.generateBadRequestErrorStanza(serverJID, sender, stanza); // TODO not defined in the standard(?)
        }

        sb.endInnerElement();
        return new IQStanza(sb.build());
    }

    /**
     * Creates the stanza to be sent for successful requests.
View Full Code Here

    public void testFromStanza() {
        StanzaBuilder builder = StanzaBuilder.createMessageStanza(JID, JID, null, "Foo");
        builder.startInnerElement("x", NamespaceURIs.XEP0045_MUC);
        builder.startInnerElement("password", NamespaceURIs.XEP0045_MUC).addText("secret").endInnerElement();
        builder.endInnerElement();

        X x = X.fromStanza(builder.build());

        assertNotNull(x);
        assertEquals("secret", x.getPasswordValue());
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.