Examples of ServiceDiscoveryManager


Examples of org.jivesoftware.smackx.ServiceDiscoveryManager

     * @return a Collection of search services found on the server.
     * @throws XMPPException thrown if a server error has occurred.
     */
    public Collection getSearchServices() throws XMPPException {
        List searchServices = new ArrayList();
        ServiceDiscoveryManager discoManager = ServiceDiscoveryManager.getInstanceFor(con);
        DiscoverItems items = discoManager.discoverItems(con.getServiceName());
        for (Iterator it = items.getItems(); it.hasNext();) {
            DiscoverItems.Item item = (DiscoverItems.Item) it.next();
            try {
                DiscoverInfo info = discoManager.discoverInfo(item.getEntityID());
                if (info.containsFeature("jabber:iq:search")) {
                    searchServices.add(item.getEntityID());
                }
            }
            catch (XMPPException e) {
View Full Code Here

Examples of rocks.xmpp.extensions.disco.ServiceDiscoveryManager

    public void testServiceDiscoveryEntry() {
        TestXmppSession connection1 = new TestXmppSession();
        StanzaForwardingManager stanzaForwardingManager = connection1.getExtensionManager(StanzaForwardingManager.class);
        // By default, the manager should be NOT enabled.
        Assert.assertFalse(stanzaForwardingManager.isEnabled());
        ServiceDiscoveryManager serviceDiscoveryManager = connection1.getExtensionManager(ServiceDiscoveryManager.class);
        Feature feature = new Feature("urn:xmpp:forward:0");
        Assert.assertFalse(serviceDiscoveryManager.getFeatures().contains(feature));
        stanzaForwardingManager.setEnabled(true);
        Assert.assertTrue(stanzaForwardingManager.isEnabled());
        Assert.assertTrue(serviceDiscoveryManager.getFeatures().contains(feature));
    }
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.