public class MucConfigFormManager extends Object
Form
used to
configure rooms.
Room configuration needs either be done right after the room is created and still locked. Or at
any later point (see XEP-45 § 10.2
Subsequent Room Configuration). When done with the configuration, call
submitConfigurationForm()
.
The manager may not provide all possible configuration options. If you want direct access to the
configuraiton form, use MultiUserChat.getConfigurationForm()
and
MultiUserChat.sendConfigurationForm(Form)
.
Modifier and Type | Field and Description |
---|---|
static String |
MUC_ROOMCONFIG_MEMBERSONLY
The constant String "muc#roomconfig_membersonly".
|
static String |
MUC_ROOMCONFIG_PASSWORDPROTECTEDROOM
The constant String "muc#roomconfig_passwordprotectedroom".
|
static String |
MUC_ROOMCONFIG_ROOMOWNERS
The constant String "muc#roomconfig_roomowners".
|
static String |
MUC_ROOMCONFIG_ROOMSECRET
The constant String "muc#roomconfig_roomsecret".
|
Modifier and Type | Method and Description |
---|---|
MucConfigFormManager |
makeMembersOnly()
Make the room for members only.
|
MucConfigFormManager |
makePasswordProtected()
Make the room password protected.
|
MucConfigFormManager |
setAndEnablePassword(String password)
Set a password and make the room password protected.
|
MucConfigFormManager |
setIsPasswordProtected(boolean isPasswordProtected)
Set if this room is password protected.
|
MucConfigFormManager |
setMembersOnly(boolean isMembersOnly)
Set if the room is members only.
|
MucConfigFormManager |
setRoomOwners(Collection<? extends Jid> newOwners)
Set the owners of the room.
|
MucConfigFormManager |
setRoomSecret(String secret)
Set the room secret, aka the room password.
|
void |
submitConfigurationForm()
Submit the configuration as
Form to the room. |
boolean |
supportsMembersOnly()
Check if the room supports a members only configuration.
|
boolean |
supportsPasswordProtected()
Check if the room supports password protection.
|
boolean |
supportsRoomOwners()
Check if the room supports room owners.
|
public static final String MUC_ROOMCONFIG_ROOMOWNERS
public static final String MUC_ROOMCONFIG_MEMBERSONLY
public static final String MUC_ROOMCONFIG_PASSWORDPROTECTEDROOM
public static final String MUC_ROOMCONFIG_ROOMSECRET
public boolean supportsRoomOwners()
true
if supported, false
if not.MUC_ROOMCONFIG_ROOMOWNERS
public MucConfigFormManager setRoomOwners(Collection<? extends Jid> newOwners) throws MultiUserChatException.MucConfigurationNotSupportedException
newOwners
- a collection of JIDs to become the new owners of the room.MultiUserChatException.MucConfigurationNotSupportedException
- if the MUC service does not support this option.MUC_ROOMCONFIG_ROOMOWNERS
public boolean supportsMembersOnly()
true
if supported, false
if not.public MucConfigFormManager makeMembersOnly() throws MultiUserChatException.MucConfigurationNotSupportedException
MultiUserChatException.MucConfigurationNotSupportedException
public MucConfigFormManager setMembersOnly(boolean isMembersOnly) throws MultiUserChatException.MucConfigurationNotSupportedException
isMembersOnly
- if the room should be members only.MultiUserChatException.MucConfigurationNotSupportedException
public boolean supportsPasswordProtected()
true
if supported, false
if not.public MucConfigFormManager setAndEnablePassword(String password) throws MultiUserChatException.MucConfigurationNotSupportedException
password
- the password to set.MultiUserChatException.MucConfigurationNotSupportedException
public MucConfigFormManager makePasswordProtected() throws MultiUserChatException.MucConfigurationNotSupportedException
MultiUserChatException.MucConfigurationNotSupportedException
public MucConfigFormManager setIsPasswordProtected(boolean isPasswordProtected) throws MultiUserChatException.MucConfigurationNotSupportedException
isPasswordProtected
- MultiUserChatException.MucConfigurationNotSupportedException
public MucConfigFormManager setRoomSecret(String secret) throws MultiUserChatException.MucConfigurationNotSupportedException
setAndEnablePassword(String)
to set a password and make the room protected.secret
- the secret/password.MultiUserChatException.MucConfigurationNotSupportedException
public void submitConfigurationForm() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Form
to the room.SmackException.NoResponseException
- if there was no response from the room.XMPPException.XMPPErrorException
SmackException.NotConnectedException
InterruptedException