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

        boolean presenceEnabled = false;
        boolean messageEnabled = false;
        boolean iqEnabled = false;
        for (String packet_type : data.getData().get("packet_type")) {
            if ("presence".equals(packet_type)) {
                presenceEnabled = true;
            }
            else if ("iq".equals(packet_type)) {
                iqEnabled = true;
            }
            else if ("message".equals(packet_type)) {
                messageEnabled = true;
            }
        }

        boolean incoming = "incoming".equals(data.getData().get("direction").get(0));
        boolean processed = "true".equals(data.getData().get("processed").get(0));

        JID componentJID = data.getOwner();
        // Create or update subscription of the component to receive packet notifications
        PacketCopier.getInstance()
                .addSubscriber(componentJID, iqEnabled, messageEnabled, presenceEnabled, incoming, processed);

        // Inform that everything went fine
        Element note = command.addElement("note");
        note.addAttribute("type", "info");
        note.setText(LocaleUtils.getLocalizedString("commands.global.operation.finished.success", preferredLocale));
    }
Command that allows to retrieve the presence of all active users.

@author Gaston Dombiak

TODO Create command for removing subscriptions. Subscriptions will now be removed when component disconnects.
xmppserver/src/main/java/org/jivesoftware/openfire/commands/admin/PacketsNotification.java