Package org.jivesoftware.smackx.packet

Examples of org.jivesoftware.smackx.packet.DiscoverInfo.containsFeature()


            if (identity.getCategory() != null)
              item.setText(2, identity.getCategory());
            if (identity.getType() != null)
              item.setText(3, identity.getType());
          }
          if (info.containsFeature("jabber:iq:register")) {
            //System.out.println(addressid + " supports registration .. ");
            item.setData("supportsRegister",true);
          }
          if (info.containsFeature("jabber:iq:search")) {
            item.setData("supportsSearch",true);
View Full Code Here


          }
          if (info.containsFeature("jabber:iq:register")) {
            //System.out.println(addressid + " supports registration .. ");
            item.setData("supportsRegister",true);
          }
          if (info.containsFeature("jabber:iq:search")) {
            item.setData("supportsSearch",true);
          }
          if(info.containsFeature("http://jabber.org/protocol/muc")) {
            item.setData("supportsMUC",true);
          }
View Full Code Here

            item.setData("supportsRegister",true);
          }
          if (info.containsFeature("jabber:iq:search")) {
            item.setData("supportsSearch",true);
          }
          if(info.containsFeature("http://jabber.org/protocol/muc")) {
            item.setData("supportsMUC",true);
          }
          item.setData("info", info);
          item.setBackground(null);
          taskObserver.finishedTask(task);
View Full Code Here

        String addressid = (String) selectedItem.getData("address");
        if (info == null)
          return;
        if (addressid == null)
          return;
        if (!info.containsFeature("jabber:iq:register"))
          return;
        Registration reg = new Registration();
        reg.setTo(addressid);
        IQ result;
        try {
View Full Code Here

     * @return true if the server supports publishing of items.
     * @throws XMPPException if the operation failed for some reason.
     */
    public boolean canPublishItems(String entityID) throws XMPPException {
        DiscoverInfo info = discoverInfo(entityID);
        return info.containsFeature("http://jabber.org/protocol/disco#publish");
    }

    /**
     * Publishes new items to a parent entity. The item elements to publish MUST have at least
     * a 'jid' attribute specifying the Entity ID of the item, and an action attribute which
View Full Code Here

                    // Send the disco packet to the server itself
                    try {
                        DiscoverInfo info = ServiceDiscoveryManager.getInstanceFor(connection)
                                .discoverInfo(serviceName);
                        // Check if the server supports JEP-33
                        if (info.containsFeature("http://jabber.org/protocol/address")) {
                            serviceAddress = serviceName;
                        }
                        else {
                            // Get the disco items and send the disco packet to each server item
                            DiscoverItems items = ServiceDiscoveryManager.getInstanceFor(connection)
View Full Code Here

                                    .discoverItems(serviceName);
                            for (Iterator it = items.getItems(); it.hasNext();) {
                                DiscoverItems.Item item = (DiscoverItems.Item) it.next();
                                info = ServiceDiscoveryManager.getInstanceFor(connection)
                                        .discoverInfo(item.getEntityID(), item.getNode());
                                if (info.containsFeature("http://jabber.org/protocol/address")) {
                                    serviceAddress = serviceName;
                                    break;
                                }
                            }
View Full Code Here

                catch (XMPPException e) {
                    // Ignore Case
                    continue;
                }

                if (info.containsFeature("jabber:iq:search")) {
                    searchServices.add(item.getEntityID());
                }
            }
            catch (Exception e) {
                // No info found.
View Full Code Here

     */
    public static boolean isServiceEnabled(Connection connection, String userID) {
        try {
            DiscoverInfo result =
                ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo(userID);
            return result.containsFeature(namespace);
        }
        catch (XMPPException e) {
            e.printStackTrace();
            return false;
        }
View Full Code Here

     * @return a boolean indicating if the server supports Flexible Offline Message Retrieval.
     * @throws XMPPException If the user is not allowed to make this request.
     */
    public boolean supportsFlexibleRetrieval() throws XMPPException {
        DiscoverInfo info = ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo(null);
        return info.containsFeature(namespace);
    }

    /**
     * Returns the number of offline messages for the user of the connection.
     *
 
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.