/** * Get a {@link MucConfigFormManager} to configure this room. * <p> * Only room owners are able to configure a room. * </p> * * @return a MUC configuration form manager for this room. * @throws NoResponseException * @throws XMPPErrorException * @throws NotConnectedException * @throws InterruptedException * @see <a href="http://xmpp.org/extensions/xep-0045.html#roomconfig">XEP-45 § 10.2 Subsequent Room Configuration</a> * @since 4.2 */ public MucConfigFormManager getConfigFormManager() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return new MucConfigFormManager(this); }
/** * Set a password and make the room password protected. Users will need to supply the password * to join the room. * * @param password the password to set. * @return a reference to this object. * @throws MucConfigurationNotSupportedException */ public MucConfigFormManager setAndEnablePassword(String password) throws MucConfigurationNotSupportedException { return setIsPasswordProtected(true).setRoomSecret(password); }
/** * Make the room for members only. * * @return a reference to this object. * @throws MucConfigurationNotSupportedException */ public MucConfigFormManager makeMembersOnly() throws MucConfigurationNotSupportedException { return setMembersOnly(true); }
/** * Set if the room is members only. Rooms are not members only per default. * * @param isMembersOnly if the room should be members only. * @return a reference to this object. * @throws MucConfigurationNotSupportedException */ public MucConfigFormManager setMembersOnly(boolean isMembersOnly) throws MucConfigurationNotSupportedException { if (!supportsMembersOnly()) { throw new MucConfigurationNotSupportedException(MUC_ROOMCONFIG_MEMBERSONLY); } answerForm.setAnswer(MUC_ROOMCONFIG_MEMBERSONLY, isMembersOnly); return this; }
/** * Make the room password protected. * * @return a reference to this object. * @throws MucConfigurationNotSupportedException */ public MucConfigFormManager makePasswordProtected() throws MucConfigurationNotSupportedException { return setIsPasswordProtected(true); }
/** * Set the owners of the room. * * @param newOwners a collection of JIDs to become the new owners of the room. * @return a reference to this object. * @throws MucConfigurationNotSupportedException if the MUC service does not support this option. * @see #MUC_ROOMCONFIG_ROOMOWNERS */ public MucConfigFormManager setRoomOwners(Collection<? extends Jid> newOwners) throws MucConfigurationNotSupportedException { if (!supportsRoomOwners()) { throw new MucConfigurationNotSupportedException(MUC_ROOMCONFIG_ROOMOWNERS); } owners.clear(); owners.addAll(newOwners); return this; }
/** * Set if this room is password protected. Rooms are by default not password protected. * * @param isPasswordProtected * @return a reference to this object. * @throws MucConfigurationNotSupportedException */ public MucConfigFormManager setIsPasswordProtected(boolean isPasswordProtected) throws MucConfigurationNotSupportedException { if (!supportsMembersOnly()) { throw new MucConfigurationNotSupportedException(MUC_ROOMCONFIG_PASSWORDPROTECTEDROOM); } answerForm.setAnswer(MUC_ROOMCONFIG_PASSWORDPROTECTEDROOM, isPasswordProtected); return this; }