Package rocks.xmpp.extensions.disco.model.info

Examples of rocks.xmpp.extensions.disco.model.info.Identity


        InfoDiscovery serviceDiscovery = iq.getExtension(InfoDiscovery.class);
        Assert.assertNotNull(serviceDiscovery);
        Assert.assertEquals(serviceDiscovery.getIdentities().size(), 2);
        Assert.assertEquals(serviceDiscovery.getFeatures().size(), 7);

        Identity identity1 = new Identity("conference", "text", "Play-Specific Chatrooms");
        Identity identity2 = new Identity("directory", "chatroom", "Play-Specific Chatrooms");

        Assert.assertTrue(serviceDiscovery.getIdentities().contains(identity1));
        Assert.assertTrue(serviceDiscovery.getIdentities().contains(identity2));
        Assert.assertTrue(serviceDiscovery.getFeatures().contains(new Feature("http://jabber.org/protocol/disco#info")));
        Assert.assertTrue(serviceDiscovery.getFeatures().contains(new Feature("http://jabber.org/protocol/disco#items")));
View Full Code Here


     * @see <a href="http://xmpp.org/extensions/xep-0045.html#disco-roominfo">6.4 Querying for Room Information</a>
     */
    public RoomInfo getRoomInfo() throws XmppException {
        InfoNode infoNode = serviceDiscoveryManager.discoverInformation(roomJid);

        Identity identity = null;
        Set<MucFeature> mucFeatures = new HashSet<>();
        RoomInfoForm roomInfoForm = null;

        if (infoNode != null) {
            Set<Identity> identities = infoNode.getIdentities();
View Full Code Here

    }

    @Test
    public void testItemsEquals() {
        ServiceDiscoveryManager serviceDiscoveryManager = xmppSession.getExtensionManager(ServiceDiscoveryManager.class);
        serviceDiscoveryManager.addIdentity(new Identity("conference", "text", "name1", "en"));
        Assert.assertTrue(serviceDiscoveryManager.getIdentities().contains(new Identity("conference", "text", "name2", "en")));
    }
View Full Code Here

    }

    @Test
    public void testSortIdentities() throws XMLStreamException, JAXBException {

        Identity identity1 = new Identity("AAA", "aaa", "name1", "en");
        Identity identity2 = new Identity("AAA", "aaa", "name2", "de");
        Identity identity3 = new Identity("AAA", "bbb", "name2", "de");
        Identity identity4 = new Identity("BBB", "bbb", "name2", "de");
        Identity identity5 = new Identity("BBB", "aaa", "name1", "en");
        Identity identity6 = new Identity("CCC", "aaa", "name2", "de");

        List<Identity> identities = new ArrayList<>();
        identities.add(identity1);
        identities.add(identity2);
        identities.add(identity3);
View Full Code Here

     * @throws NoSuchAlgorithmException If SHA-1 algorithm could not be found.
     */
    @Test
    public void testVerificationString() throws NoSuchAlgorithmException {
        List<Identity> identities = new ArrayList<>();
        identities.add(new Identity("client", "pc", "Exodus 0.9.1"));

        List<Feature> features = new ArrayList<>();
        features.add(new Feature("http://jabber.org/protocol/disco#info"));
        features.add(new Feature("http://jabber.org/protocol/disco#items"));
        features.add(new Feature("http://jabber.org/protocol/muc"));
View Full Code Here

     * @throws NoSuchAlgorithmException If SHA-1 algorithm could not be found.
     */
    @Test
    public void testVerificationStringComplex() throws NoSuchAlgorithmException {
        List<Identity> identities = new ArrayList<>();
        identities.add(new Identity("client", "pc", "Psi 0.11", "en"));
        identities.add(new Identity("client", "pc", "P 0.11", "el"));

        List<Feature> features = new ArrayList<>();
        features.add(new Feature("http://jabber.org/protocol/caps"));
        features.add(new Feature("http://jabber.org/protocol/disco#info"));
        features.add(new Feature("http://jabber.org/protocol/disco#items"));
View Full Code Here

    }

    @Test
    public void testVerificationStringWithExtendedForm() throws NoSuchAlgorithmException {
        List<Identity> identities = new ArrayList<>();
        identities.add(new Identity("client", "pc", "Exodus 0.9.1"));

        List<Feature> features = new ArrayList<>();
        features.add(new Feature("http://jabber.org/protocol/disco#info"));
        features.add(new Feature("http://jabber.org/protocol/disco#items"));
        features.add(new Feature("http://jabber.org/protocol/muc"));
View Full Code Here

    }

    @Test
    public void testVerificationString3() throws NoSuchAlgorithmException {
        List<Identity> identities = new ArrayList<>();
        identities.add(new Identity("client", "pc"));

        List<Feature> features = new ArrayList<>();
        features.add(new Feature("http://jabber.org/protocol/disco#info"));
        features.add(new Feature("http://jabber.org/protocol/disco#items"));
        features.add(new Feature("urn:xmpp:ping"));
View Full Code Here

     * @throws rocks.xmpp.core.stanza.model.StanzaException If the entity returned a stanza error.
     * @throws rocks.xmpp.core.session.NoResponseException  If the entity did not respond.
     */
    public NodeInfo getNodeInfo() throws XmppException {
        InfoNode infoNode = serviceDiscoveryManager.discoverInformation(pubSubServiceAddress);
        Identity identity = null;
        Set<PubSubFeature> features = new HashSet<>();
        PubSubMetaDataForm metaDataForm = null;

        if (infoNode != null) {
            Set<Identity> identities = infoNode.getIdentities();
View Full Code Here

TOP

Related Classes of rocks.xmpp.extensions.disco.model.info.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.