Examples of startInnerElement()


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

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

        StanzaBuilder sb = StanzaBuilder.createIQStanza(serverJID, sender, IQStanzaType.RESULT, iqStanzaID);
        sb.startInnerElement("pubsub", NamespaceURIs.XEP0060_PUBSUB);
        String nodeName = extractNodeName(stanza);
       
        List<SubscriptionItem> subscriptions = collectSubscriptions(root, sender, nodeName);

        buildSuccessStanza(sb, nodeName, subscriptions);
View Full Code Here

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

        Entity sender = extractSenderJID(stanza, sessionContext);

        String iqStanzaID = stanza.getAttributeValue("id");

        StanzaBuilder sb = StanzaBuilder.createIQStanza(serverJID, sender, IQStanzaType.RESULT, iqStanzaID);
        sb.startInnerElement("pubsub", NamespaceURIs.XEP0060_PUBSUB);

        XMLElement publish = stanza.getFirstInnerElement().getFirstInnerElement(); // pubsub/publish
        String nodeName = publish.getAttributeValue("node"); // MUST

        XMLElement item = publish.getFirstInnerElement();
View Full Code Here

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

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

        StanzaBuilder sb = StanzaBuilder.createIQStanza(serverJID, sender, IQStanzaType.RESULT, iqStanzaID);
        sb.startInnerElement("pubsub", NamespaceURIs.XEP0060_PUBSUB);
       
        List<AffiliationItem> subscriptions = collectAffiliations(root, sender);

        buildSuccessStanza(sb, subscriptions);
View Full Code Here

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

        Entity subJID = null;

        String iqStanzaID = stanza.getAttributeValue("id");

        StanzaBuilder sb = StanzaBuilder.createIQStanza(serverJID, sender, IQStanzaType.RESULT, iqStanzaID);
        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

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

        Entity sender = extractSenderJID(stanza, sessionContext);

        String iqStanzaID = stanza.getAttributeValue("id");
        StanzaBuilder sb = StanzaBuilder.createIQStanza(serverJID, sender, IQStanzaType.RESULT, iqStanzaID);
        sb.startInnerElement("pubsub", NamespaceURIs.XEP0060_PUBSUB_OWNER);
       
        String nodeName = extractNodeName(stanza);
        LeafNode node = root.find(nodeName);

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

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

        CollectionNode root = serviceConfiguration.getRootNode();
        Entity sender = extractSenderJID(stanza, sessionContext);

        String iqStanzaID = stanza.getAttributeValue("id");
        StanzaBuilder sb = StanzaBuilder.createIQStanza(serverJID, sender, IQStanzaType.RESULT, iqStanzaID);
        sb.startInnerElement("pubsub", NamespaceURIs.XEP0060_PUBSUB_OWNER);

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

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

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

        String queryKey = getKey(x);
        String privateDataXML = persistenceManager.getPrivateData(from, queryKey);

        StanzaBuilder stanzaBuilder = StanzaBuilder.createIQStanza(stanza.getTo(), stanza.getFrom(), IQStanzaType.RESULT, stanza.getID());
        if (privateDataXML == null) {
            stanzaBuilder.startInnerElement(x.getName());
            for (Attribute a : x.getAttributes()) {
                stanzaBuilder.addAttribute(a);
            }
            stanzaBuilder.endInnerElement();
        } else {
View Full Code Here

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

        // If no vCard exists, the server MUST return a stanza error (which SHOULD be <item-not-found/>)
        // or an IQ-result containing an empty <vCard/> element.
        if (vcardXml == null) {
            IQStanzaType iqStanzaType = returnEmptyVCardWhenNonExistent ? IQStanzaType.RESULT : IQStanzaType.ERROR;
            StanzaBuilder stanzaBuilder = StanzaBuilder.createIQStanza(stanza.getTo(), stanza.getFrom(), iqStanzaType, stanza.getID());
            stanzaBuilder.startInnerElement("vCard", NamespaceURIs.VCARD_TEMP).endInnerElement();
            if (returnEmptyVCardWhenNonExistent) {
                // keep it like it is
            } else {
                stanzaBuilder.
                    startInnerElement("error").addAttribute("type", "cancel").
View Full Code Here

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

            StanzaBuilder stanzaBuilder = StanzaBuilder.createIQStanza(stanza.getTo(), stanza.getFrom(), iqStanzaType, stanza.getID());
            stanzaBuilder.startInnerElement("vCard", NamespaceURIs.VCARD_TEMP).endInnerElement();
            if (returnEmptyVCardWhenNonExistent) {
                // keep it like it is
            } else {
                stanzaBuilder.
                    startInnerElement("error").addAttribute("type", "cancel").
                        startInnerElement("item-not-found", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS).
                        endInnerElement().
                    endInnerElement();
            }
View Full Code Here

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

        Entity subJID = null;

        String iqStanzaID = stanza.getAttributeValue("id");

        StanzaBuilder sb = StanzaBuilder.createIQStanza(serverJID, sender, IQStanzaType.RESULT, iqStanzaID);
        sb.startInnerElement("pubsub", NamespaceURIs.XEP0060_PUBSUB);

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

        try {
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.