@Override
    public void process(Request request, TreeNode<Resource> resultNode, String href) {
      Resource r = resultNode.getObject();
      TreeNode<Resource> parent = resultNode.getParent();

      if (parent.getName() != null) {

        int i = href.indexOf("?");
        if (i != -1) {
          href = href.substring(0, i);
        }

        if (!href.endsWith("/")) {
          href = href + '/';
        }

        Schema schema = getClusterController().getSchema(r.getType());
        Object id = r.getPropertyValue(schema.getKeyPropertyId(r.getType()));

        String hrefIdPart = urlencode(id);

        href = parent.getStringProperty("isCollection").equals("true") ?
            href + hrefIdPart : href + parent.getName() + '/' + hrefIdPart;
      }
      resultNode.setProperty("href", href);
    }
Constructor.

@param resourceType the resource type
@param subTypes     the sub-resource types
@param directives   a map of directives for request types for this resource
ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseResourceDefinition.java