Package org.apache.vysper.xmpp.modules.extension.xep0060_pubsub.model

Examples of org.apache.vysper.xmpp.modules.extension.xep0060_pubsub.model.LeafNode


            // error condition 1 (6.1.3)
            return errorStanzaGenerator.generateJIDDontMatchErrorStanza(sender, serverJID, stanza);
        }

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

        if (node == null) {
            // no such node (error condition 11 (6.1.3))
            return errorStanzaGenerator.generateNoNodeErrorStanza(sender, serverJID, stanza);
        }

        String id = idGenerator.create();
        node.subscribe(id, subJID);

        buildSuccessStanza(sb, nodeName, strSubJID, id);

        sb.endInnerElement(); // pubsub
        return new IQStanza(sb.build());
View Full Code Here


        List<InfoElement> infoElements = new ArrayList<InfoElement>();
        if (request.getNode() == null || request.getNode().length() == 0) {
            infoElements.add(new Identity("pubsub", "service", "Publish-Subscribe"));
            infoElements.add(new Feature(NamespaceURIs.XEP0060_PUBSUB));
        } else {
            LeafNode node = root.find(request.getNode());
            infoElements.addAll(node.getNodeInfosFor(request));
        }
        return infoElements;
    }
View Full Code Here

            }
            ServiceDiscoItemsVisitor nv = new ServiceDiscoItemsVisitor(serviceConfiguration);
            root.acceptNodes(nv);
            items = nv.getNodeItemList();
        } else {
            LeafNode node = root.find(request.getNode());
            NodeDiscoItemsVisitor iv = new NodeDiscoItemsVisitor(request.getTo());
            node.acceptItems(iv);
            items = iv.getItemList();
        }

        return items;
    }
View Full Code Here

        if (nodeName == null) { // all subscriptions for all nodes
            NodeSubscriberVisitor nodeSubscriptionVisitor = new NodeSubscriberVisitor(sender);
            root.acceptNodes(nodeSubscriptionVisitor);
            subscriptions = nodeSubscriptionVisitor.getSubscriptions();
        } else { // only the subscriptions for the requested node
            LeafNode node = root.find(nodeName);

            if (node == null) {
                // done - this is only a filter - no error conditions are defined
                subscriptions = Collections.emptyList();
            } else {
                SubscriberSubscriptionVisitor subscriptionVisitor = new SubscriberSubscriptionVisitor(sender);
                node.acceptSubscribers(subscriptionVisitor);
                subscriptions = subscriptionVisitor.getSubscriptions();
            }
        }
        return subscriptions;
    }
View Full Code Here

        if (root.find(nodeName) != null) {
            return errorStanzaGenerator.generateDuplicateNodeErrorStanza(sender, serverJID, stanza);
        }

        LeafNode node = new LeafNode(serviceConfiguration, nodeName, sender);
        root.add(node);

        return new IQStanza(sb.build());
    }
View Full Code Here

TOP

Related Classes of org.apache.vysper.xmpp.modules.extension.xep0060_pubsub.model.LeafNode

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.