예제 #1
0
  /**
   * Creates a new ServiceDiscoveryManager for a given connection. This means that the service
   * manager will respond to any service discovery request that the connection may receive.
   *
   * @param connection the connection to which a ServiceDiscoveryManager is going to be created.
   */
  public ServiceDiscoveryManager(Connection connection) {
    this.connection = connection;

    // For every XMPPConnection, add one EntityCapsManager.
    if (connection instanceof XMPPConnection) {
      setEntityCapsManager(new EntityCapsManager());
      capsManager.addCapsVerListener(new CapsPresenceRenewer());
    }

    renewEntityCapsVersion();

    init();
  }
예제 #2
0
 /**
  * Removes the dataform containing extended service discovery information from the information
  * returned by this XMPP entity.
  *
  * <p>Since no packet is actually sent to the server it is safe to perform this operation before
  * logging to the server.
  */
 public void removeExtendedInfo() {
   extendedInfo = null;
   renewEntityCapsVersion();
 }
예제 #3
0
 /**
  * Removes the specified feature from the supported features by this XMPP entity.
  *
  * <p>Since no packet is actually sent to the server it is safe to perform this operation before
  * logging to the server.
  *
  * @param feature the feature to remove from the supported features.
  */
 public void removeFeature(String feature) {
   synchronized (features) {
     features.remove(feature);
     renewEntityCapsVersion();
   }
 }
예제 #4
0
 /**
  * Registers extended discovery information of this XMPP entity. When this client is queried for
  * its information this data form will be returned as specified by XEP-0128.
  *
  * <p>Since no packet is actually sent to the server it is safe to perform this operation before
  * logging to the server. In fact, you may want to configure the extended info before logging to
  * the server so that the information is already available if it is required upon login.
  *
  * @param info the data form that contains the extend service discovery information.
  */
 public void setExtendedInfo(DataForm info) {
   extendedInfo = info;
   renewEntityCapsVersion();
 }
예제 #5
0
 /**
  * Registers that a new feature is supported by this XMPP entity. When this client is queried for
  * its information the registered features will be answered.
  *
  * <p>Since no packet is actually sent to the server it is safe to perform this operation before
  * logging to the server. In fact, you may want to configure the supported features before logging
  * to the server so that the information is already available if it is required upon login.
  *
  * @param feature the feature to register as supported.
  */
 public void addFeature(String feature) {
   synchronized (features) {
     features.add(feature);
     renewEntityCapsVersion();
   }
 }