code: public RegisteredCommand findCommand(String owner, HttpMethod method, String uri, String query,
                                           Map<String, String> variableMap) {
          String cmdOwner = Utils.isEmpty(owner) ? SYSTEM_OWNER : owner;
          RegisteredCommand cmd = null;
          while (cmd == null && !Utils.isEmpty(cmdOwner)) {
              cmd = searchCommands(cmdOwner, method, uri, query, variableMap);
              cmdOwner = m_parentMap.get(cmdOwner);
          }
          return cmd;
      }
docs: Attempt to find a command that matches the properties of a REST request. If a match
  is found, the corresponding {@link RegisteredCommand} is returned and the given
  variable map is populated with extracted parameters. For example, if the command's
  URI template is:
  <pre>
  /{application}/_query?{params}
  </pre>
  And the actual URI and query components provided are:
  <pre>
  /MyApp/_query?q=Smith&s=100
  </pre>
  The variable map will be populated with to reflect the following variable settings:
  <pre>
  application = MyApp
  params = q=Smith&s=100
  </pre>
  If any parameter values are URI-encoded, they remain encoded when returned in the
  updated variable map.
  
  @param owner         The command owner that defines the command set to search. If
  null or empty, only system commands are searched. Otherwise,
  the given owner's commands are searched followed by its parent
  commands, if any.
  @param method        The {@link HttpMethod} of the REST request. To match, a
  command must be registerd with this as one of its methods.
  @param uri           The URI provided in the REST request. The URI must remain
  encoded so that path nodes can be properly recognized.
  @param query         The query parameter of the REST request, if any. May be null
  or empty if the request has no query component.
  @param variableMap   Updated with variables extracted from URI and query parameters.
  Not touched if the command does not match.
  @return              The {@link RegisteredCommand} that matched the given request
  or null if a match was not found.