Class EntityCapabilitiesManager

  • All Implemented Interfaces:
    Module, UserEventListener, org.xmpp.component.IQResultListener

    public class EntityCapabilitiesManager
    extends BasicModule
    implements org.xmpp.component.IQResultListener, UserEventListener
    Implements server side mechanics for XEP-0115: "Entity Capabilities" Version 1.4 In particular, EntityCapabilitiesManager is useful for processing "filtered-notifications" for use with Pubsub (XEP-0060) for contacts that may not want to receive notifications for all payload types. The server's role in managing Entity Capabilities is to cache previously encountered entity capabilities for XMPP clients supporting the same identities and features. If the server has not seen a particular combination of identities and features, a Discover Information query is sent to that client and its reply is cached for future use by clients sharing those same entity capabilities.
    Author:
    Armando Jagucki
    • Field Detail

      • OPENFIRE_IDENTIFIER_NODE

        public static final String OPENFIRE_IDENTIFIER_NODE
        A XEP-0115 described identifier for the Openfire server software, intended to be used as a value of 'node' attributes.
        See Also:
        Constant Field Values
    • Constructor Detail

      • EntityCapabilitiesManager

        public EntityCapabilitiesManager()
    • Method Detail

      • initialize

        public void initialize​(XMPPServer server)
        Description copied from class: BasicModule

        Initializes the basic module.

        Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.

        Specified by:
        initialize in interface Module
        Overrides:
        initialize in class BasicModule
        Parameters:
        server - the server hosting this module.
      • destroy

        public void destroy()
        Description copied from class: BasicModule

        Destroys the module.

        Does nothing in the basic module.

        Specified by:
        destroy in interface Module
        Overrides:
        destroy in class BasicModule
      • process

        public void process​(org.xmpp.packet.Presence packet)
      • answerTimeout

        public void answerTimeout​(String packetId)
        Specified by:
        answerTimeout in interface org.xmpp.component.IQResultListener
      • receivedAnswer

        public void receivedAnswer​(org.xmpp.packet.IQ packet)
        Specified by:
        receivedAnswer in interface org.xmpp.component.IQResultListener
      • getEntityCapabilities

        public EntityCapabilities getEntityCapabilities​(org.xmpp.packet.JID jid)
        Returns the entity capabilities for a specific JID. The specified JID should be a full JID that identified the entity's connection.
        Parameters:
        jid - the full JID of entity
        Returns:
        the entity capabilities of jid, or null if these are unavailable.
      • checkObsolete

        protected void checkObsolete​(String verHash)
        Verifies if the provided 'ver' hash is used for any user. If not, the cache entry containing the entity capabilities are removed from the cache.
        Parameters:
        verHash - an 'ver' hash (cannot be null).
      • getLocalDomainVerHash

        public static String getLocalDomainVerHash()
        Returns the 'ver' hash for this server.
        Returns:
        A 'ver' hash, or null if none could be generated.