Class MucClientManager

  • All Implemented Interfaces:
    org.jitsi.xmpp.mucclient.ConnectionStateListener

    
    public class MucClientManager
     implements ConnectionStateListener
                        

    Manages a set of MucClient, each of which represents an XMPP client connection (via an XMPPConnection) and a Multi-User Chat. Allows loading the configuration of a MucClient from properties in a ConfigurationService, as well as adding and removing MucClients dynamically.

    Author:

    Boris Grozev

    • Constructor Detail

      • MucClientManager

        MucClientManager()
        Initializes a new MucClientManager instance.
      • MucClientManager

        MucClientManager(Array<String> features)
        Initializes a new MucClientManager instance.
        Parameters:
        features - the features to use for disco#info.
    • Method Detail

      • setPresenceExtension

         void setPresenceExtension(ExtensionElement extension)

        Adds an ExtensionElement to the presence of all our MucClients, and removes any other extensions with the same element name and namespace, if any exist.

        Parameters:
        extension - the extension to add.
      • removePresenceExtension

         void removePresenceExtension(String elementName, String namespace)

        Removes an ExtensionElement with a particular element name and namespace from the presence of all our MucClients.

        Parameters:
        elementName - the name of the element of the extension to remove.
        namespace - the namespace of the element of the extension to remove.
      • registerIQ

         void registerIQ(IQ iq, boolean requireResponse)

        Indicates to this instance that the registered IQ listener is interested in IQs with a specific child element name and namespace, represented in an IQ.

        Parameters:
        iq - the IQ which represents a [element name, namespace] pair.
        requireResponse - whether to send an error stanza as a response if the IQListener produces null for requests of this type.
      • registerIQ

         void registerIQ(String elementName, String namespace, boolean requireResponse)

        Indicates to this instance that the registered IQ listener is interested in IQs with a specific element name and namespace.

        Parameters:
        elementName - the child element name.
        namespace - the child element namespace.
        requireResponse - whether to send an error stanza as a response if the IQListener produces null for requests of this type.
      • removeMucClient

         boolean removeMucClient(String id)

        Stops and removes a MucClient identified by its ID.

        Parameters:
        id - the ID of the client to remove.
        Returns:

        true if a MucClient with this specified ID exists and was removed, and false otherwise.

      • stop

         void stop()

        Stops and removed all MucClients.

      • getMucCount

         long getMucCount()

        Return the number of configured MUCs.

      • getMucJoinedCount

         long getMucJoinedCount()

        Return the number of MUCs that have been successfully joined.

      • setIQListener

         void setIQListener(IQListener iqListener)

        Sets the IQ listener which will be called when an IQ of a registered type is received (see registerIQ).

        Parameters:
        iqListener - the listener to set.