Class RoomConfiguration

  • All Implemented Interfaces:
    StandardizedDataForm

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

    Usage

    To wrap an existing DataForm to retrieve standard data from it, use:
    
     RoomConfiguration roomConfiguration = new RoomConfiguration(dataForm);
     
    To build a form:
    
     RoomConfiguration roomConfiguration = RoomConfiguration.builder()
         .maxHistoryMessages(4)
         .rolesThatMaySendPrivateMessages(Arrays.asList(Role.MODERATOR, Role.PARTICIPANT))
         .invitesAllowed(true)
         .changeSubjectAllowed(true)
         .loggingEnabled(true)
         .rolesThatMayRetrieveMemberList(Collections.singleton(Role.PARTICIPANT))
         .language("en")
         .pubSubNode(URI.create("xmpp:pubsub.shakespeare.lit?;node=princely_musings"))
         .maxUsers(30)
         .membersOnly(true)
         .moderated(true)
         .passwordProtected(true)
         .persistent(true)
         .rolesForWhichPresenceIsBroadcast(Arrays.asList(Role.MODERATOR, Role.PARTICIPANT))
         .publicRoom(true)
         .administrators(Arrays.asList(Jid.of("admin1"), Jid.of("admin2")))
         .description("description")
         .name("name")
         .owners(Arrays.asList(Jid.of("owner1"), Jid.of("owner2")))
         .password("pass")
         .rolesThatMayDiscoverRealJids(EnumSet.of(Role.MODERATOR))
         .build();
     
    See Also:
    10.1.3 Creating a Reserved Room, 15.5.3 muc#roomconfig FORM_TYPE
    • Constructor Detail

      • RoomConfiguration

        public RoomConfiguration​(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.
      • getRolesThatMaySendPrivateMessages

        public Collection<Role> getRolesThatMaySendPrivateMessages()
        Gets the roles that may send private messages.
        Returns:
        The roles.
      • isInvitesAllowed

        public boolean isInvitesAllowed()
        Indicates, whether to allow occupants to invite others.
        Returns:
        True, if occupants are allowed to invite others.
      • isChangeSubjectAllowed

        public boolean isChangeSubjectAllowed()
        Indicates, whether to allow occupants to change subject.
        Returns:
        True, if occupants are allowed to change subject.
      • isLoggingEnabled

        public boolean isLoggingEnabled()
        Indicates, whether to enable public logging of room conversations.
        Returns:
        True, if public logging of room conversations is enabled.
      • getRolesThatMayRetrieveMemberList

        public Collection<Role> getRolesThatMayRetrieveMemberList()
        Gets the roles which may retrieve member list.
        Returns:
        The roles which may retrieve member list.
      • getLanguage

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

        public URI getPubSubNode()
        Gets the XMPP URI of associated publish-subscribe node.
        Returns:
        The URI.
      • getMaxUsers

        public Integer getMaxUsers()
        Gets the maximum number of room occupants.
        Returns:
        The maximum number of room occupants.
      • isMembersOnly

        public boolean isMembersOnly()
        Indicates, whether the room is members-only.
        Returns:
        True, if the room is members-only.
      • isModerated

        public boolean isModerated()
        Indicates, whether the room is moderated.
        Returns:
        True, if the room is moderated.
      • isPasswordProtected

        public boolean isPasswordProtected()
        Indicates, whether the room is password protected.
        Returns:
        True, if the room is password protected.
      • isPersistent

        public boolean isPersistent()
        Indicates, whether the room is persistent.
        Returns:
        True, if the room is persistent.
      • getRolesForWhichPresenceIsBroadcast

        public Collection<Role> getRolesForWhichPresenceIsBroadcast()
        Gets the roles for which presence is broadcast.
        Returns:
        The roles for which presence is broadcast.
      • isPublicRoom

        public boolean isPublicRoom()
        Indicates, whether the room is public.
        Returns:
        True, if the room is public.
      • getAdministrators

        public Collection<Jid> getAdministrators()
        Gets the administrators.
        Returns:
        The administrators.
      • getDescription

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

        public String getName()
        Gets the natural-language room name.
        Returns:
        The room name.
      • getOwners

        public Collection<Jid> getOwners()
        Gets the owners.
        Returns:
        The owners.
      • getPassword

        public String getPassword()
        Gets the room password.
        Returns:
        The password.
      • getRolesThatMayDiscoverRealJids

        public Collection<Role> getRolesThatMayDiscoverRealJids()
        Get the roles, which may discover real JIDs.
        Returns:
        The roles, which may discover real JIDs.
      • toBuilder

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