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 standardizedDataFormwith form typehttp://jabber.org/protocol/muc#roomconfig, which can be used to configure a MUC room.Usage
To wrap an existingDataFormto 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 classRoomConfiguration.BuilderA 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.Builderbuilder()Collection<Jid>getAdministrators()Gets the administrators.DataFormgetDataForm()Gets the underlying form.StringgetDescription()Gets a short description.StringgetFormType()Gets the form type of the data form.LocalegetLanguage()Gets the natural language for room discussions.IntegergetMaxHistoryMessages()Gets the maximum number of history messages returned by the room.IntegergetMaxUsers()Gets the maximum number of room occupants.StringgetName()Gets the natural-language room name.Collection<Jid>getOwners()Gets the owners.StringgetPassword()Gets the room password.URIgetPubSubNode()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.booleanisChangeSubjectAllowed()Indicates, whether to allow occupants to change subject.booleanisInvitesAllowed()Indicates, whether to allow occupants to invite others.booleanisLoggingEnabled()Indicates, whether to enable public logging of room conversations.booleanisMembersOnly()Indicates, whether the room is members-only.booleanisModerated()Indicates, whether the room is moderated.booleanisPasswordProtected()Indicates, whether the room is password protected.booleanisPersistent()Indicates, whether the room is persistent.booleanisPublicRoom()Indicates, whether the room is public.RoomConfiguration.BuildertoBuilder()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:StandardizedDataFormGets the form type of the data form.- Specified by:
getFormTypein interfaceStandardizedDataForm- Returns:
- The form type.
-
getDataForm
public DataForm getDataForm()
Gets the underlying form.- Specified by:
getDataFormin 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.
-
-