@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();

        // Get the username
        String username;
        try {
            username = get(data, "username", 0);
        }
        catch (NullPointerException npe) {
            note.addAttribute("type", "error");
            note.setText(LocaleUtils.getLocalizedString("commands.event.vcardcreated.note.username-required", preferredLocale));
            return;
        }

        // Loads the new vCard
        Element vCard = VCardManager.getProvider().loadVCard(username);

        if (vCard == null) {
            note.addAttribute("type", "error");
            note.setText(LocaleUtils.getLocalizedString("commands.event.vcardcreated.note.vcard-does-not-exist", preferredLocale));
            return;
        }

        // Fire event.
        VCardEventDispatcher.dispatchVCardCreated(username, vCard);

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

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