@Override
    public Iterator<Element> getIdentities(String name, String node, JID senderJID) {
        Element identity = DocumentHelper.createElement("identity");
        identity.addAttribute("category", "automation");
        identity.addAttribute("type", NAMESPACE.equals(node) ? "command-list" : "command-node");
        return Collections.singleton(identity).iterator();
    }
Manager that keeps the list of ad-hoc commands and processing command requests.
xmppserver/src/main/java/org/jivesoftware/openfire/commands/AdHocCommandHandler.java