private void populateResource(HttpPropertyRequest httpPropertyRequest, Resource resource,
                                Cluster cluster, String hostName, String publicHostName) throws SystemException {

    String url = httpPropertyRequest.getUrl(cluster, hostName);

    try {
      InputStream inputStream = streamProvider.readFrom(url);

      try {
        httpPropertyRequest.populateResource(resource, inputStream);
      } finally {
        try {
          inputStream.close();
        } catch (IOException ioe) {
          LOG.error(String.format("Error closing HTTP response stream %s", url), ioe);
        }
      }
    } catch (Exception e) {
      LOG.debug(String.format("Error reading HTTP response from %s", url), e);
      if(publicHostName != null && !publicHostName.equalsIgnoreCase(hostName)) {
        String publicUrl = httpPropertyRequest.getUrl(cluster, publicHostName);
        LOG.debug(String.format("Retry using public host name url %s", publicUrl));
        try {
          InputStream inputStream = streamProvider.readFrom(publicUrl);

          try {
            httpPropertyRequest.populateResource(resource, inputStream);
          } finally {
            try {
              inputStream.close();
            } catch (IOException ioe) {
              LOG.error(String.format("Error closing HTTP response stream %s", url), ioe);
            }
          }
        } catch (Exception ex) {
          LOG.debug(String.format("Error reading HTTP response from public host name url %s", url), ex);
        }
      }
    }
  }
Property provider for host component resources that is used to read HTTP data from another server.
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HttpPropertyProvider.java