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 standardizedDataFormwith form typehttp://jabber.org/protocol/muc#roominfo, which can be used to retrieve MUC room info.Usage
To wrap an existingDataFormto 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 classRoomInfo.BuilderA builder to build a room info form.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RoomInfo.Builderbuilder()List<Jid>getContacts()Gets the contact addresses (normally room owners).IntegergetCurrentNumberOfOccupants()Gets the current number of occupants in the room.DataFormgetDataForm()Gets the underlying data form.StringgetDescription()Gets a short description.StringgetFormType()Gets the form type of the data form.LocalegetLanguage()Gets the natural language for room discussions.StringgetLdapGroup()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.URLgetLogs()Gets an URL for archived discussion logs.IntegergetMaxHistoryMessages()Gets the maximum number of history messages returned by the room.StringgetSubject()Gets the current discussion topic.booleanisChangeSubjectAllowed()Indicates, whether the room subject can be modified by participants.RoomInfo.BuildertoBuilder()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:StandardizedDataFormGets the form type of the data form.- Specified by:
getFormTypein interfaceStandardizedDataForm- Returns:
- The form type.
-
getDataForm
public final DataForm getDataForm()
Gets the underlying data form.- Specified by:
getDataFormin 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.
-
-