Class RoomInfo

  • All Implemented Interfaces:
    StandardizedDataForm

    public final class RoomInfo
    extends Object
    implements StandardizedDataForm
    Represents a standardized DataForm with form type http://jabber.org/protocol/muc#roominfo, which can be used to retrieve MUC room info.

    Usage

    To wrap an existing DataForm to retrieve standard data from it, use:
    
     RoomInfo roomInfo = new RoomInfo(dataForm);
     
    To build a form:
    
     RoomInfo roomInfo = RoomInfo.builder()
         .maxHistoryMessages(50)
         .contacts(Arrays.asList(Jid.of("contact1"), Jid.of("contact2")))
         .description("The place for all good witches!")
         .language("en")
         .ldapGroup("cn=witches,dc=shakespeare,dc=lit")
         .logs(new URL("http://www.shakespeare.lit/chatlogs/coven/"))
         .currentNumberOfOccupants(45)
         .subject("Spells")
         .changeSubjectAllowed(true)
         .build();
     
    See Also:
    6.4 Querying for Room Information, 15.5.4 muc#roominfo FORM_TYPE
    • Constructor Detail

      • RoomInfo

        public RoomInfo​(DataForm dataForm)
    • Method Detail

      • getMaxHistoryMessages

        public Integer getMaxHistoryMessages()
        Gets the maximum number of history messages returned by the room.
        Returns:
        The maximum number of history messages returned by the room.
      • getContacts

        public List<Jid> getContacts()
        Gets the contact addresses (normally room owners).
        Returns:
        The contact addresses.
      • getDescription

        public String getDescription()
        Gets a short description.
        Returns:
        The description.
      • getLanguage

        public Locale getLanguage()
        Gets the natural language for room discussions.
        Returns:
        The language.
      • getLdapGroup

        public String getLdapGroup()
        Gets an associated LDAP group that defines room membership; this should be an LDAP Distinguished Name according to an implementation-specific or deployment-specific definition of a group.
        Returns:
        The LDAP group.
      • getLogs

        public URL getLogs()
        Gets an URL for archived discussion logs.
        Returns:
        The URL.
      • getCurrentNumberOfOccupants

        public Integer getCurrentNumberOfOccupants()
        Gets the current number of occupants in the room.
        Returns:
        The number of occupants.
      • getSubject

        public String getSubject()
        Gets the current discussion topic.
        Returns:
        The topic.
      • isChangeSubjectAllowed

        public boolean isChangeSubjectAllowed()
        Indicates, whether the room subject can be modified by participants.
        Returns:
        Whether the room subject can be modified by participants.
      • toBuilder

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