Package org.apache.vysper.xmpp.modules.servicediscovery.management

Examples of org.apache.vysper.xmpp.modules.servicediscovery.management.Identity


        return Collections.unmodifiableSet(set);
    }

    public List<InfoElement> getInfosFor(InfoRequest request) throws ServiceDiscoveryRequestException {
        List<InfoElement> infoElements = new ArrayList<InfoElement>();
        infoElements.add(new Identity("conference", "text", getName()));
        infoElements.add(new Feature(NamespaceURIs.XEP0045_MUC));

        for (RoomType type : roomTypes) {
            if (type.includeInDisco()) {
                infoElements.add(new Feature(type.getDiscoName()));
View Full Code Here


        return Collections.unmodifiableSet(set);
    }

    public List<InfoElement> getInfosFor(InfoRequest request) throws ServiceDiscoveryRequestException {
        List<InfoElement> infoElements = new ArrayList<InfoElement>();
        infoElements.add(new Identity("conference", "text", getName()));
        infoElements.add(new Feature(NamespaceURIs.XEP0045_MUC));

        for (RoomType type : roomTypes) {
            if (type.includeInDisco()) {
                infoElements.add(new Feature(type.getDiscoName()));
View Full Code Here

        }
        if (allCommandInfos.size() == 0) return null; // do not announce when no command available

        final CommandInfo commandInfo = allCommandInfos.get(0);
        final ArrayList<InfoElement> infoElements = new ArrayList<InfoElement>();
        infoElements.add(new Identity("automation", "command-node", commandInfo.getName()));
        infoElements.add(new Feature(NamespaceURIs.XEP0050_ADHOC_COMMANDS));
        infoElements.add(new Feature(NamespaceURIs.JABBER_X_DATA));
        return infoElements;
       
    }
View Full Code Here

    public List<InfoElement> getServerInfosFor(InfoRequest request) {
        if (request.getNode() != null && request.getNode().length() > 0) return null;
       
        List<InfoElement> infoElements = new ArrayList<InfoElement>();
        infoElements.add(new Identity("conference", "text", getName()));
        infoElements.add(new Feature(NamespaceURIs.XEP0045_MUC));
        return infoElements;
    }
View Full Code Here

            return null;

        CollectionNode root = serviceConfiguration.getRootNode();
        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));
        }
View Full Code Here

     * @param request the sent request
     * @return the list of InfoElements
     */
    public List<InfoElement> getNodeInfosFor(InfoRequest request) {
        List<InfoElement> infoElements = new ArrayList<InfoElement>();
        infoElements.add(new Identity("pubsub", "leaf"));
        infoElements.add(new Feature(NamespaceURIs.XEP0060_PUBSUB));
        infoElements.add(PubsubFeatures.ACCESS_OPEN.getFeature());
        infoElements.add(PubsubFeatures.ITEM_IDS.getFeature());
        infoElements.add(PubsubFeatures.PERSISTENT_ITEMS.getFeature());
        infoElements.add(PubsubFeatures.MULTI_SUBSCRIBE.getFeature());
View Full Code Here

        return Arrays.asList(NamespaceURIs.XEP0045_MUC);
    }

    @Override
    protected Identity getExpectedIdentity() {
        return new Identity("conference", "text", "Foo");
    }
View Full Code Here

            return null;

        CollectionNode root = serviceConfiguration.getRootNode();
        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));
        }
View Full Code Here

        request.startInnerElement("query", NamespaceURIs.XEP0030_SERVICE_DISCOVERY_INFO).endInnerElement();
        return request;
    }

    private void assertIdentity(XMLElement queryElement) throws XMLSemanticError {
        Identity expectedIdentity = getExpectedIdentity();
        if (expectedIdentity != null) {
            XMLElement identityElement = queryElement.getSingleInnerElementsNamed("identity");

            assertNotNull("Identity element must exist", identityElement);

            assertEquals("Identity category", expectedIdentity.getCategory(), identityElement
                    .getAttributeValue("category"));
            assertEquals("Identity type", expectedIdentity.getType(), identityElement.getAttributeValue("type"));

            if (expectedIdentity.getName() != null) {
                assertEquals("Identity name", expectedIdentity.getName(), identityElement.getAttributeValue("name"));
            } else {
                assertNull("Identity name attribute should be missing", identityElement.getAttributeValue("name"));
            }
        }
    }
View Full Code Here

        return module;
    }

    @Override
    protected Identity getExpectedIdentity() {
        return new Identity("conference", "text", "Room1");
    }
View Full Code Here

TOP

Related Classes of org.apache.vysper.xmpp.modules.servicediscovery.management.Identity

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.