Class EntityCapsManager


  • public final class EntityCapsManager
    extends Manager
    Manages own and others Entity Capabilities (XEP-0115).

    Entity Capabilities is an XMPP extension which, in order to minimize network impact, caches the capabilities of remote XMPP entities. Those capabilities are determine with the help of the Service Discovery Protocol (XEP-0030, ServiceDiscoveryManager).

    Usage

    Entity Capabilities work silently in the background when enabled. If the remote XMPP entity does not support XEP-0115 but XEP-0030 then XEP-0030 mechanisms are transparently used.

    The caches used by Smack for Entity Capabilities is non-persisent per default. However, it is is also possible to set a persistent Entity Capabilities cache, which is recommended.

    Examples

    Enable Entity Capabilities

    
     // Get an instance of entity caps manager for the specified connection
     EntityCapsManager mgr = EntityCapsManager.getInstanceFor(connection);
     // Enable entity capabilities
     mgr.enableEntityCaps();
     

    Configure a persistent cache for Entity Capabilities

    
     // Get an instance of entity caps manager for the specified connection
     EntityCapsManager mgr = EntityCapsManager.getInstanceFor(connection);
     // Create an cache, see smackx.entitycaps.cache for pre-defined cache implementations
     EntityCapsPersistentCache cache = new SimpleDirectoryPersistentCache(new File("/foo/cachedir"));
     // Set the cache
     mgr.setPersistentCache(cache);
     
    See Also:
    XEP-0115: Entity Capabilities