/** * 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) { if (!features.contains(feature)) { features.add(feature); renewEntityCapsVersion(); } } }
/** * Removes the data form 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(); }
/** * 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(); }
/** * 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(); } }
/** * Remove an identity from the client. Note that the client needs at least one identity, the * default identity, which can not be removed. * * @param identity * @return true, if successful. Otherwise the default identity was given. */ public boolean removeIdentity(DiscoverInfo.Identity identity) { if (identity.equals(this.identity)) return false; identities.remove(identity); renewEntityCapsVersion(); return true; }
/** * Add an identity to the client. * * @param identity */ public void addIdentity(DiscoverInfo.Identity identity) { identities.add(identity); renewEntityCapsVersion(); }
/** * Sets the type of client that will be returned when asked for the client identity in a disco * request. The valid types are defined by the category client. Follow this link to learn the * possible types: <a * href="http://xmpp.org/registrar/disco-categories.html#client">Jabber::Registrar</a>. * * @param type the type of client that will be returned when asked for the client identity in a * disco request. */ @SuppressWarnings("deprecation") public void setIdentityType(String type) { identity.setType(type); renewEntityCapsVersion(); }
/** * Sets the name of the client that will be returned when asked for the client identity in a disco * request. The name could be any value you need to identity this client. * * @param name the name of the client that will be returned when asked for the client identity in * a disco request. */ public void setIdentityName(String name) { identity.setName(name); renewEntityCapsVersion(); }
/** * Sets the default identity the client will report. * * @param identity */ public void setIdentity(Identity identity) { if (identity == null) throw new IllegalArgumentException("Identity can not be null"); this.identity = identity; renewEntityCapsVersion(); }