Package rocks.xmpp.extensions.muc.model
Class RoomInfo
- java.lang.Object
-
- rocks.xmpp.extensions.muc.model.RoomInfo
-
- All Implemented Interfaces:
StandardizedDataForm
public final class RoomInfo extends Object implements StandardizedDataForm
Represents a standardizedDataForm
with form typehttp://jabber.org/protocol/muc#roominfo
, which can be used to retrieve MUC room info.Usage
To wrap an existingDataForm
to retrieve standard data from it, use:
To build a form:RoomInfo roomInfo = new RoomInfo(dataForm);
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();
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RoomInfo.Builder
A builder to build a room info form.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RoomInfo.Builder
builder()
List<Jid>
getContacts()
Gets the contact addresses (normally room owners).Integer
getCurrentNumberOfOccupants()
Gets the current number of occupants in the room.DataForm
getDataForm()
Gets the underlying data 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.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.URL
getLogs()
Gets an URL for archived discussion logs.Integer
getMaxHistoryMessages()
Gets the maximum number of history messages returned by the room.String
getSubject()
Gets the current discussion topic.boolean
isChangeSubjectAllowed()
Indicates, whether the room subject can be modified by participants.RoomInfo.Builder
toBuilder()
Converts this (immutable) data form to a builder, so that a modified form can be created.
-
-
-
Field Detail
-
FORM_TYPE
public static final String FORM_TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RoomInfo
public RoomInfo(DataForm dataForm)
-
-
Method Detail
-
builder
public static RoomInfo.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.
-
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.
-
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 final DataForm getDataForm()
Gets the underlying data form.- Specified by:
getDataForm
in interfaceStandardizedDataForm
- Returns:
- The underlying data form.
-
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.
-
-