Package org.apache.vysper.xmpp.stanza

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


        Entity sender = extractSenderJID(stanza, sessionContext);
        String iqStanzaID = stanza.getAttributeValue("id");

        StanzaBuilder sb = StanzaBuilder.createDirectReply(stanza, false, IQStanzaType.RESULT);
        sb.startInnerElement("pubsub", NamespaceURIs.XEP0060_PUBSUB);

        List<AffiliationItem> subscriptions = collectAffiliations(root, sender);

        buildSuccessStanza(sb, subscriptions);
View Full Code Here


        Entity sender = extractSenderJID(stanza, sessionContext);
        Entity subJID = null;

        StanzaBuilder sb = StanzaBuilder.createDirectReply(stanza, false, IQStanzaType.RESULT);
        sb.startInnerElement("pubsub", NamespaceURIs.XEP0060_PUBSUB);

        XMLElement unsub = stanza.getFirstInnerElement().getFirstInnerElement(); // pubsub/unsubscribe
        String strSubJID = unsub.getAttributeValue("jid"); // MUST
        String strSubID = unsub.getAttributeValue("subid"); // SHOULD (req. for more than one subscription)
View Full Code Here

        room.addOccupant(OCCUPANT1_JID, "nick");
        room.addOccupant(OCCUPANT2_JID, "Nick 2");

        StanzaBuilder request = StanzaBuilder.createIQStanza(OCCUPANT1_JID, new EntityImpl(ROOM1_JID, "Nick 2"),
                IQStanzaType.GET, "123");
        request.startInnerElement("query", getNamespace()).endInnerElement();

        // send message to room
        sendDisco(request.build());

        assertNull(occupant1Queue.getNext());
View Full Code Here

        Entity sender = extractSenderJID(stanza, sessionContext);
        Entity subJID = null;

        StanzaBuilder sb = StanzaBuilder.createDirectReply(stanza, false, IQStanzaType.RESULT);
        sb.startInnerElement("pubsub", NamespaceURIs.XEP0060_PUBSUB);

        XMLElement sub = stanza.getFirstInnerElement().getFirstInnerElement(); // pubsub/subscribe
        String strSubJID = sub.getAttributeValue("jid"); // MUST

        try {
View Full Code Here

        CollectionNode root = serviceConfiguration.getRootNode();

        Entity sender = extractSenderJID(stanza, sessionContext);

        StanzaBuilder sb = StanzaBuilder.createDirectReply(stanza, false, IQStanzaType.RESULT);
        sb.startInnerElement("pubsub", NamespaceURIs.XEP0060_PUBSUB_OWNER);

        String nodeName = extractNodeName(stanza);
        LeafNode node = root.find(nodeName);

        if (node == null) {
View Full Code Here

     * @param node the name of the node
     * @return the generated stanza
     */
    public Stanza getStanza(Entity client, Entity pubsub, String id, String node) {
        StanzaBuilder stanzaBuilder = StanzaBuilder.createIQStanza(client, pubsub, getStanzaType(), id);
        stanzaBuilder.startInnerElement("pubsub", getNamespace());

        buildInnerElement(client, pubsub, stanzaBuilder, node);

        stanzaBuilder.endInnerElement();

View Full Code Here

    }

    private void relayDiscoStanza(Entity receiver, InfoRequest request, String ns) {
        StanzaBuilder builder = StanzaBuilder.createIQStanza(request.getFrom(), receiver, IQStanzaType.GET, request
                .getID());
        builder.startInnerElement("query", ns);
        if (request.getNode() != null) {
            builder.addAttribute("node", request.getNode());
        }

        try {
View Full Code Here

            for (XMLElement innerElement : innerElements) {
                builder.addPreparedElement(innerElement);
            }
        }

        builder.startInnerElement("error", NamespaceURIs.JABBER_CLIENT).addAttribute("type", type);
        builder.startInnerElement(errorName, NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS).endInnerElement();
        builder.endInnerElement();

        return builder.build();
    }
View Full Code Here

                builder.addPreparedElement(innerElement);
            }
        }

        builder.startInnerElement("error", NamespaceURIs.JABBER_CLIENT).addAttribute("type", type);
        builder.startInnerElement(errorName, NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS).endInnerElement();
        builder.endInnerElement();

        return builder.build();
    }
View Full Code Here

        for (XMLElement inner : originalStanza.getInnerElements()) {
            builder.addPreparedElement(inner);
        }

        builder.startInnerElement("error", NamespaceURIs.JABBER_CLIENT).addAttribute("type", type.value());
        builder.startInnerElement(error.value(), NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS).endInnerElement();
        builder.endInnerElement();

        return builder.build();
    }
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.