Interface ExtendedDiscoInfoProvider

All Known Implementing Classes:
ContactAddressesExtendedDiscoInfoProvider, SoftwareInfoExtendedDiscoInfoProvider

public interface ExtendedDiscoInfoProvider
Provides extended service discovery information using XEP-0128 data form extensions.

Implementations of this interface can contribute additional XEP-0004 data forms to disco#info responses, enabling plugin-controlled additions to service discovery as defined by XEP-0128. This supports use cases such as:

  • Adding custom fields to existing forms (e.g. what the MUC Extended Info plugin does)
  • Providing entirely new data forms with custom FORM_TYPE values (e.g. XEP-0232: Software Information, XEP-0504: Data Policy)

When multiple providers return forms with the same FORM_TYPE, the forms are merged by combining their fields. However, each field must be unique within a form type. If two providers contribute fields with the same field name to the same FORM_TYPE, this is treated as a configuration error. The duplicate provider's entire contribution is skipped and a warning is logged. Other providers continue to be processed normally. Implementations may wish to check IQDiscoInfoHandler.DISABLE_EXPOSURE and return an empty set when it is true, to respect privacy configurations that suppress exposure of administrative details.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Set<org.xmpp.forms.DataForm>
    getExtendedInfos(String domain, String name, String node, org.xmpp.packet.JID senderJID)
    Returns a collection of data forms with extended information about the entity.
  • Method Details

    • getExtendedInfos

      Set<org.xmpp.forms.DataForm> getExtendedInfos(String domain, String name, String node, org.xmpp.packet.JID senderJID)
      Returns a collection of data forms with extended information about the entity.

      The returned Set may be empty but should not be null. It may be immutable. Forms should include a FORM_TYPE field to enable proper merging.

      Parameters:
      domain - the domain of the target JID (e.g., "localhost", "conference.localhost", "pubsub.localhost")
      name - the node part of the target JID (null for service-level queries)
      node - the requested disco node parameter (null if not specified)
      senderJID - the XMPPAddress of user that sent the disco info request
      Returns:
      A Set of data forms (possibly empty, never null). May be immutable.