Package rocks.xmpp.extensions.muc.model
Class RoomConfiguration
- java.lang.Object
-
- rocks.xmpp.extensions.muc.model.RoomConfiguration
-
- All Implemented Interfaces:
StandardizedDataForm
public final class RoomConfiguration extends Object implements StandardizedDataForm
Represents a standardizedDataForm
with form typehttp://jabber.org/protocol/muc#roomconfig
, which can be used to configure a MUC room.Usage
To wrap an existingDataForm
to retrieve standard data from it, use:
To build a form:RoomConfiguration roomConfiguration = new RoomConfiguration(dataForm);
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();
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RoomConfiguration.Builder
A builder to build a room configuration.
-
Constructor Summary
Constructors Constructor Description RoomConfiguration(DataForm dataForm)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RoomConfiguration.Builder
builder()
Collection<Jid>
getAdministrators()
Gets the administrators.DataForm
getDataForm()
Gets the underlying form.String
getDescription()
Gets a short description.String
getFormType()
Gets the form type of the data form.Locale
getLanguage()
Gets the natural language for room discussions.Integer
getMaxHistoryMessages()
Gets the maximum number of history messages returned by the room.Integer
getMaxUsers()
Gets the maximum number of room occupants.String
getName()
Gets the natural-language room name.Collection<Jid>
getOwners()
Gets the owners.String
getPassword()
Gets the room password.URI
getPubSubNode()
Gets the XMPP URI of associated publish-subscribe node.Collection<Role>
getRolesForWhichPresenceIsBroadcast()
Gets the roles for which presence is broadcast.Collection<Role>
getRolesThatMayDiscoverRealJids()
Get the roles, which may discover real JIDs.Collection<Role>
getRolesThatMayRetrieveMemberList()
Gets the roles which may retrieve member list.Collection<Role>
getRolesThatMaySendPrivateMessages()
Gets the roles that may send private messages.boolean
isChangeSubjectAllowed()
Indicates, whether to allow occupants to change subject.boolean
isInvitesAllowed()
Indicates, whether to allow occupants to invite others.boolean
isLoggingEnabled()
Indicates, whether to enable public logging of room conversations.boolean
isMembersOnly()
Indicates, whether the room is members-only.boolean
isModerated()
Indicates, whether the room is moderated.boolean
isPasswordProtected()
Indicates, whether the room is password protected.boolean
isPersistent()
Indicates, whether the room is persistent.boolean
isPublicRoom()
Indicates, whether the room is public.RoomConfiguration.Builder
toBuilder()
Converts this (immutable) data form to a builder, so that a modified form can be created.
-
-
-
Constructor Detail
-
RoomConfiguration
public RoomConfiguration(DataForm dataForm)
-
-
Method Detail
-
builder
public static RoomConfiguration.Builder builder()
-
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.
-
getFormType
public final String getFormType()
Description copied from interface:StandardizedDataForm
Gets the form type of the data form.- Specified by:
getFormType
in interfaceStandardizedDataForm
- Returns:
- The form type.
-
getDataForm
public DataForm getDataForm()
Gets the underlying form.- Specified by:
getDataForm
in interfaceStandardizedDataForm
- Returns:
- The underlying data form.
-
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.
-
-