private Element generateProbeResult(Locale preferredLocale) {
        final DataForm configurationForm = new DataForm(DataForm.Type.form);
        configurationForm.setTitle(LocaleUtils.getLocalizedString("muc.form.conf.title", preferredLocale));
        List<String> params = new ArrayList<>();
        params.add(room.getName());
        configurationForm.addInstruction(LocaleUtils.getLocalizedString("muc.form.conf.instruction", params, preferredLocale));

        configurationForm.addField("FORM_TYPE", null, Type.hidden)
                .addValue("http://jabber.org/protocol/muc#roomconfig");

        configurationForm.addField("muc#roomconfig_roomname",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_roomname", preferredLocale),
                Type.text_single);

        configurationForm.addField("muc#roomconfig_roomdesc",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_roomdesc", preferredLocale),
                Type.text_single);

        configurationForm.addField("muc#roomconfig_changesubject",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_changesubject", preferredLocale),
                Type.boolean_type);

        final FormField maxUsers = configurationForm.addField(
                "muc#roomconfig_maxusers",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_maxusers", preferredLocale),
                Type.list_single);
        maxUsers.addOption("10", "10");
        maxUsers.addOption("20", "20");
        maxUsers.addOption("30", "30");
        maxUsers.addOption("40", "40");
        maxUsers.addOption("50", "50");
        maxUsers.addOption(LocaleUtils.getLocalizedString("muc.form.conf.none", preferredLocale), "0");

        final FormField broadcast = configurationForm.addField(
                "muc#roomconfig_presencebroadcast",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_presencebroadcast", preferredLocale),
                Type.list_multi);
        broadcast.addOption(LocaleUtils.getLocalizedString("muc.form.conf.moderator", preferredLocale), "moderator");
        broadcast.addOption(LocaleUtils.getLocalizedString("muc.form.conf.participant", preferredLocale), "participant");
        broadcast.addOption(LocaleUtils.getLocalizedString("muc.form.conf.visitor", preferredLocale), "visitor");

        configurationForm.addField("muc#roomconfig_publicroom",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_publicroom", preferredLocale),
                Type.boolean_type);

        configurationForm.addField("muc#roomconfig_persistentroom",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_persistentroom", preferredLocale),
                Type.boolean_type);

        configurationForm.addField("{http://igniterealtime.org}muc#roomconfig_retireondel",
            LocaleUtils.getLocalizedString("muc.form.conf.owner_retireondel", preferredLocale),
            Type.boolean_type);

        configurationForm.addField("muc#roomconfig_moderatedroom",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_moderatedroom", preferredLocale),
                Type.boolean_type);

        configurationForm.addField("muc#roomconfig_membersonly",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_membersonly", preferredLocale),
                Type.boolean_type);

        configurationForm.addField(null, null, Type.fixed)
                .addValue(LocaleUtils.getLocalizedString("muc.form.conf.allowinvitesfixed", preferredLocale));

        configurationForm.addField("muc#roomconfig_allowinvites",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_allowinvites", preferredLocale),
                Type.boolean_type);

        configurationForm.addField("muc#roomconfig_passwordprotectedroom",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_passwordprotectedroom", preferredLocale),
                Type.boolean_type);

        configurationForm.addField(null, null, Type.fixed)
                .addValue(LocaleUtils.getLocalizedString("muc.form.conf.roomsecretfixed", preferredLocale));

        configurationForm.addField("muc#roomconfig_roomsecret",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_roomsecret", preferredLocale),
                Type.text_private);

        final FormField whois = configurationForm.addField(
                "muc#roomconfig_whois",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_whois", preferredLocale),
                Type.list_single);
        whois.addOption(LocaleUtils.getLocalizedString("muc.form.conf.moderator", preferredLocale), "moderators");
        whois.addOption(LocaleUtils.getLocalizedString("muc.form.conf.anyone", preferredLocale), "anyone");

        final FormField allowpm = configurationForm.addField(
                "muc#roomconfig_allowpm",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_allowpm", preferredLocale),
                Type.list_single);
        allowpm.addOption(LocaleUtils.getLocalizedString("muc.form.conf.anyone", preferredLocale), "anyone");
        allowpm.addOption(LocaleUtils.getLocalizedString("muc.form.conf.moderator", preferredLocale), "moderators");
        allowpm.addOption(LocaleUtils.getLocalizedString("muc.form.conf.participant", preferredLocale), "participants");
        allowpm.addOption(LocaleUtils.getLocalizedString("muc.form.conf.none", preferredLocale), "none");

        configurationForm.addField("muc#roomconfig_enablelogging",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_enablelogging", preferredLocale),
                Type.boolean_type);

        configurationForm.addField("{http://igniterealtime.org}muc#roomconfig_preservehistondel",
            LocaleUtils.getLocalizedString("muc.form.conf.owner_preservehistondel", preferredLocale),
            Type.boolean_type);

        configurationForm.addField("x-muc#roomconfig_reservednick",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_reservednick", preferredLocale),
                Type.boolean_type);

        configurationForm.addField("x-muc#roomconfig_canchangenick",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_canchangenick", preferredLocale),
                Type.boolean_type);

        configurationForm.addField(null, null, Type.fixed)
                .addValue(LocaleUtils.getLocalizedString("muc.form.conf.owner_registration", preferredLocale));

        configurationForm.addField("x-muc#roomconfig_registration",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_registration", preferredLocale),
                Type.boolean_type);

        configurationForm.addField(null, null, Type.fixed)
                .addValue(LocaleUtils.getLocalizedString("muc.form.conf.roomadminsfixed", preferredLocale));

        configurationForm.addField("muc#roomconfig_roomadmins",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_roomadmins", preferredLocale),
                Type.jid_multi);

        configurationForm.addField(null, null, Type.fixed)
                .addValue(LocaleUtils.getLocalizedString("muc.form.conf.roomownersfixed", preferredLocale));

        configurationForm.addField("muc#roomconfig_roomowners",
                LocaleUtils.getLocalizedString("muc.form.conf.owner_roomowners", preferredLocale),
                Type.jid_multi);

        // Add room-specific data values to the form.
        synchronized (room) {
            FormField field = configurationForm.getField("muc#roomconfig_roomname");
            field.clearValues();
            field.addValue(room.getNaturalLanguageName());

            field = configurationForm.getField("muc#roomconfig_roomdesc");
            field.clearValues();
            field.addValue(room.getDescription());

            field = configurationForm.getField("muc#roomconfig_changesubject");
            field.clearValues();
            field.addValue((room.canOccupantsChangeSubject() ? "1" : "0"));

            field = configurationForm.getField("muc#roomconfig_maxusers");
            field.clearValues();
            field.addValue(Integer.toString(room.getMaxUsers()));

            field = configurationForm.getField("muc#roomconfig_presencebroadcast");
            field.clearValues();
            for (Role roleToBroadcast : room.getRolesToBroadcastPresence()) {
                field.addValue(roleToBroadcast.toString());
            }

            field = configurationForm.getField("muc#roomconfig_publicroom");
            field.clearValues();
            field.addValue((room.isPublicRoom() ? "1" : "0"));

            field = configurationForm.getField("muc#roomconfig_persistentroom");
            field.clearValues();
            field.addValue((room.isPersistent() ? "1" : "0"));

            field = configurationForm.getField("muc#roomconfig_moderatedroom");
            field.clearValues();
            field.addValue((room.isModerated() ? "1" : "0"));

            field = configurationForm.getField("{http://igniterealtime.org}muc#roomconfig_retireondel");
            field.clearValues();
            field.addValue((room.isRetireOnDeletion() ? "1" : "0"));

            field = configurationForm.getField("muc#roomconfig_membersonly");
            field.clearValues();
            field.addValue((room.isMembersOnly() ? "1" : "0"));

            field = configurationForm.getField("muc#roomconfig_allowinvites");
            field.clearValues();
            field.addValue((room.canOccupantsInvite() ? "1" : "0"));

            field = configurationForm.getField("muc#roomconfig_passwordprotectedroom");
            field.clearValues();
            field.addValue((room.isPasswordProtected() ? "1" : "0"));

            field = configurationForm.getField("muc#roomconfig_roomsecret");
            field.clearValues();
            field.addValue(room.getPassword());

            field = configurationForm.getField("muc#roomconfig_whois");
            field.clearValues();
            field.addValue((room.canAnyoneDiscoverJID() ? "anyone" : "moderators"));

            field = configurationForm.getField("muc#roomconfig_allowpm");
            field.clearValues();
            field.addValue((room.canSendPrivateMessage() ));

            field = configurationForm.getField("muc#roomconfig_enablelogging");
            field.clearValues();
            field.addValue((room.isLogEnabled() ? "1" : "0"));

            field = configurationForm.getField("{http://igniterealtime.org}muc#roomconfig_preservehistondel");
            field.clearValues();
            field.addValue((room.isPreserveHistOnRoomDeletionEnabled() ? "1" : "0"));

            field = configurationForm.getField("x-muc#roomconfig_reservednick");
            field.clearValues();
            field.addValue((room.isLoginRestrictedToNickname() ? "1" : "0"));

            field = configurationForm.getField("x-muc#roomconfig_canchangenick");
            field.clearValues();
            field.addValue((room.canChangeNickname() ? "1" : "0"));

            field = configurationForm.getField("x-muc#roomconfig_registration");
            field.clearValues();
            field.addValue((room.isRegistrationEnabled() ? "1" : "0"));

            field = configurationForm.getField("muc#roomconfig_roomadmins");
            field.clearValues();
            for (JID jid : room.getAdmins()) {
                if (GroupJID.isGroup(jid)) {
                    try {
                        // add each group member to the result (clients don't understand groups)
                        Group group = GroupManager.getInstance().getGroup(jid);
                        for (JID groupMember : group.getAll()) {
                            field.addValue(groupMember);
                        }
                    } catch (GroupNotFoundException gnfe) {
                        Log.warn("Invalid group JID in the member list: " + jid);
                    }
                } else {
                    field.addValue(jid.toString());
                }
            }

            field = configurationForm.getField("muc#roomconfig_roomowners");
            field.clearValues();
            for (JID jid : room.getOwners()) {
                if (GroupJID.isGroup(jid)) {
                    try {
                        // add each group member to the result (clients don't understand groups)
                        Group group = GroupManager.getInstance().getGroup(jid);
                        for (JID groupMember : group.getAll()) {
                            field.addValue(groupMember);
                        }
                    } catch (GroupNotFoundException gnfe) {
                        Log.warn("Invalid group JID in the member list: " + jid);
                    }
                } else {
                    field.addValue(jid.toString());
                }
            }
        }

        final Element element = DocumentHelper.createElement(QName.get("query",
            "http://jabber.org/protocol/muc#owner"));
        element.add(configurationForm.getElement());
        return element;
    }
Processes the completed form sent by an owner of the room. This will modify the room's
configuration as well as the list of owners and admins.

@param completedForm the completed form sent by an owner of the room.
@param actorAffiliation the room affiliation of the user that sent the completed form.
@param actorJid the (real) user address of the user that sent the completed form.
@throws ForbiddenException if the user does not have enough privileges.
@throws ConflictException If the room was going to lose all of its owners.
@throws NotAcceptableException if the room requires a password that was not supplied
xmppserver/src/main/java/org/jivesoftware/openfire/muc/spi/IQOwnerHandler.java