protected  PageResponse getResources(Type type, Request request, Predicate predicate,
                                       PageRequest pageRequest, SortRequest sortRequest)
      throws UnsupportedPropertyException,
      SystemException,
      NoSuchResourceException,
      NoSuchParentResourceException {

    QueryResponse queryResponse = getResources(type, request, predicate);
    populateResources(type, queryResponse.getResources(), request, predicate);
    return getPage(type, queryResponse, request, predicate, pageRequest, sortRequest);
  }
Get a page of resources filtered by the given request, predicate objects and
page request.

@param type         type of resources
@param request      the request
@param predicate    the predicate object which filters which resources are returned
@param pageRequest  the page request for a paginated response

@return a page response representing the requested page of resources

@throws UnsupportedPropertyException thrown if the request or predicate contain
                                     unsupported property ids
@throws SystemException an internal exception occurred
@throws NoSuchResourceException no matching resource(s) found
@throws NoSuchParentResourceException a specified parent resource doesn't exist
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterControllerImpl.java