@Override
    public void execute(@Nonnull SessionData sessionData, Element command) {
        final Locale preferredLocale = SessionManager.getInstance().getLocaleForSession(sessionData.getOwner());

        Element note = command.addElement("note");

        Map<String, List<String>> data = sessionData.getData();

        // Input validation
        final Set<String> inputValidationErrors = new HashSet<>();

        Group group = null;
        final String groupName = get(data, "groupName", 0);
        if (StringUtils.isBlank(groupName)) {
            inputValidationErrors.add(LocaleUtils.getLocalizedString("commands.event.groupdeleting.note.groupname-required", preferredLocale));
        } else {
            try {
                group = GroupManager.getInstance().getGroup(groupName);
            } catch (GroupNotFoundException e) {
                inputValidationErrors.add(LocaleUtils.getLocalizedString("commands.event.groupdeleting.note.group-does-not-exist", List.of(groupName), preferredLocale));
            }
        }

        if (!inputValidationErrors.isEmpty()) {
            note.addAttribute("type", "error");
            note.setText(StringUtils.join(inputValidationErrors, " "));
            return;
        }

        // Perform post-processing (cache updates and event notifications).
        GroupManager.getInstance().deleteGroupPreProcess(group);
        // Since the group is about to be deleted by the provided, mark it as removed in the caches.
        GroupManager.getInstance().deleteGroupPostProcess(group);

        // Answer that the operation was successful
        note.addAttribute("type", "info");
        note.setText(LocaleUtils.getLocalizedString("commands.global.operation.finished.success", preferredLocale));
    }
Notifies the that a group is being deleted. It can be used by user providers to notify Openfire of the
deletion of a group.

@author Gabriel Guarincerri
xmppserver/src/main/java/org/jivesoftware/openfire/commands/event/GroupDeleting.java