code: public void registerCommand(String node, final String name, LocalCommandFactory factory) {
          AdHocCommandInfo commandInfo = new AdHocCommandInfo(node, name, connection().getUser(), factory);
  
          commands.put(node, commandInfo);
          // Set the NodeInformationProvider that will provide information about
          // the added command
          serviceDiscoveryManager.setNodeInformationProvider(node,
                  new AbstractNodeInformationProvider() {
                      @Override
                      public List<String> getNodeFeatures() {
                          List<String> answer = new ArrayList<>();
                          answer.add(NAMESPACE);
                          // TODO: check if this service is provided by the
                          // TODO: current connection.
                          answer.add("jabber:x:data");
                          return answer;
                      }
                      @Override
                      public List<DiscoverInfo.Identity> getNodeIdentities() {
                          List<DiscoverInfo.Identity> answer = new ArrayList<>();
                          DiscoverInfo.Identity identity = new DiscoverInfo.Identity(
                                  "automation", name, "command-node");
                          answer.add(identity);
                          return answer;
                      }
                  });
      }
docs: Registers a new command with this command manager, which is related to a
  connection. The <tt>node</tt> is an unique identifier of that
  command for the connection related to this command manager. The <tt>name</tt>
  is the human readable name of the command. The <tt>factory</tt> generates
  new instances of the command.
  
  @param node the unique identifier of the command.
  @param name the human readable name of the command.
  @param factory a factory to create new instances of the command.