Package org.jivesoftware.smackx

Examples of org.jivesoftware.smackx.ServiceDiscoveryManager.discoverItems()


     * @throws XMPPException if an error occured while trying to discover MUC services.
     */
    public static Collection<String> getServiceNames(Connection connection) throws XMPPException {
        final List<String> answer = new ArrayList<String>();
        ServiceDiscoveryManager discoManager = ServiceDiscoveryManager.getInstanceFor(connection);
        DiscoverItems items = discoManager.discoverItems(connection.getServiceName());
        for (Iterator<DiscoverItems.Item> it = items.getItems(); it.hasNext();) {
            DiscoverItems.Item item = it.next();
            try {
                DiscoverInfo info = discoManager.discoverInfo(item.getEntityID());
                if (info.containsFeature("http://jabber.org/protocol/muc")) {
View Full Code Here


     */
    public static Collection<HostedRoom> getHostedRooms(Connection connection, String serviceName)
            throws XMPPException {
        List<HostedRoom> answer = new ArrayList<HostedRoom>();
        ServiceDiscoveryManager discoManager = ServiceDiscoveryManager.getInstanceFor(connection);
        DiscoverItems items = discoManager.discoverItems(serviceName);
        for (Iterator<DiscoverItems.Item> it = items.getItems(); it.hasNext();) {
            answer.add(new HostedRoom(it.next()));
        }
        return answer;
    }
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.