class HttpPropertyProvider extends BaseProvider implements PropertyProvider {

  @Override
  public Set<Resource> populateResources(Set<Resource> resources,
                                         Request request, Predicate predicate) throws SystemException {

    Set<String> ids = getRequestPropertyIds(request, predicate);

    if (ids.size() == 0) {
      return resources;
    }

    for (Resource resource : resources) {
      String clusterName = (String) resource.getPropertyValue(clusterNamePropertyId);
      String hostName = (String) resource.getPropertyValue(hostNamePropertyId);
      String publicHostName = (String) resource.getPropertyValue(publicHostNamePropertyId);
      String componentName = (String) resource.getPropertyValue(componentNamePropertyId);

      if (clusterName != null && hostName != null && componentName != null &&
          httpPropertyRequests.containsKey(componentName)) {

        try {
          Cluster cluster = clusters.getCluster(clusterName);

          List<HttpPropertyRequest> httpPropertyRequestList = httpPropertyRequests.get(componentName);

          for (HttpPropertyRequest httpPropertyRequest : httpPropertyRequestList) {
            populateResource(httpPropertyRequest, resource, cluster, hostName, publicHostName);
          }
        } catch (AmbariException e) {
          String msg = String.format("Could not load cluster with name %s.", clusterName);
          LOG.debug(msg, e);
          throw new SystemException(msg, e);
        }
      }
    }
    return resources;
  }

  public  HttpPropertyProvider(
      StreamProvider stream,
      Clusters clusters,
      String clusterNamePropertyId,
      String hostNamePropertyId,
      String publicHostNamePropertyId,
      String componentNamePropertyId,
      Map<String, List<HttpPropertyRequest>> httpPropertyRequests);

}