Class NodeMetaData

  • All Implemented Interfaces:
    StandardizedDataForm

    public final class NodeMetaData
    extends Object
    implements StandardizedDataForm
    Represents a standardized DataForm with form type http://jabber.org/protocol/pubsub#meta-data, which can be used to retrieve node meta data.

    Usage

    To wrap an existing DataForm to retrieve standard data from it, use:
    
     NodeMetaData nodeMetaData = new NodeMetaData(dataForm);
     
    To build a form:
    
     NodeMetaData nodeMetaData = NodeMetaData.builder()
         .contacts(Collections.singleton(Jid.of("contact")))
         .creationDate(date)
         .creator(Jid.of("creator"))
         .description("desc")
         .language("de")
         .numberOfSubscribers(2)
         .owners(Collections.singleton(Jid.of("owner")))
         .publishers(Collections.singleton(Jid.of("publisher")))
         .title("title")
         .payloadType("namespace")
         .build();
     
    See Also:
    5.4 Discover Node Metadata, 16.4.3 pubsub#meta-data FORM_TYPE
    • Constructor Detail

      • NodeMetaData

        public NodeMetaData​(DataForm dataForm)
        Creates a node meta data form.
        Parameters:
        dataForm - The underlying data form.
    • Method Detail

      • builder

        public static NodeMetaData.Builder builder()
        Creates the builder to build a meta data form.
        Returns:
        The builder.
      • getContacts

        public final List<Jid> getContacts()
        Gets the contacts.
        Returns:
        The contacts.
      • getCreationDate

        public final Instant getCreationDate()
        Gets the creation date.
        Returns:
        The creation date.
      • getCreator

        public final Jid getCreator()
        Gets the creator.
        Returns:
        The creator.
      • getDescription

        public final String getDescription()
        Gets the description.
        Returns:
        The description.
      • getLanguage

        public final Locale getLanguage()
        Gets the language.
        Returns:
        The language.
      • getNumberOfSubscribers

        public final Integer getNumberOfSubscribers()
        Gets the number of subscribers.
        Returns:
        The subscribers.
      • getOwners

        public final List<Jid> getOwners()
        Gets the owners.
        Returns:
        The owners.
      • getPublishers

        public final List<Jid> getPublishers()
        Gets the publishers.
        Returns:
        The publishers.
      • getNodeTitle

        public final String getNodeTitle()
        Gets the title.
        Returns:
        The title.
      • getPayloadType

        public final String getPayloadType()
        Gets the payload type of the node.
        Returns:
        The payload type.
      • toBuilder

        public final NodeMetaData.Builder toBuilder()
        Converts this (immutable) data form to a builder, so that a modified form can be created.
        Returns:
        The builder.