public Set<PropertyInfo> getServiceProperties(StackId stackId, String serviceName, boolean removeExcluded)
      throws AmbariException {
    ServiceInfo service = ambariMetaInfo.getService(stackId.getStackName(), stackId.getStackVersion(), serviceName);
    Set<PropertyInfo> properties = new HashSet<>(service.getProperties());

    if (removeExcluded) {
      Set<String> excludedConfigTypes = service.getExcludedConfigTypes();

      // excludedConfigTypes can be null since org.apache.ambari.server.state.ServiceInfo.setExcludedConfigTypes()
      // allows for null values
      if ((excludedConfigTypes != null) && !excludedConfigTypes.isEmpty()) {
        // Iterate through the set of found PropertyInfo instances and remove ones that should be
        // excluded.
        Iterator<PropertyInfo> iterator = properties.iterator();

        while (iterator.hasNext()) {
          PropertyInfo propertyInfo = iterator.next();

          // If the config type for the current PropertyInfo is containing within an excluded type,
          // remove it from the set of properties being returned
          if (excludedConfigTypes.contains(ConfigHelper.fileNameToConfigType(propertyInfo.getFilename()))) {
            iterator.remove();
          }
        }
      }
    }

    return properties;
  }
Retrieves a Set of PropertyInfo objects containing the relevant properties for the requested
service.
<p/>
If <code>removeExcluded</code> is <code>true</code>, the service's excluded configuration types
are used to prune off PropertyInfos that should be ignored; else if <code>false</code>, all
PropertyInfos will be returned.

@param stackId        a StackId declaring the relevant stack
@param serviceName    a String containing the requested service's name
@param removeExcluded a boolean value indicating whether to remove properties from excluded
                      configuration types (<code>true</code>) or return the complete set of properties regardless of exclusions (<code>false</code>)
@return a Set of PropertyInfo objects for the requested service
@throws AmbariException if the requested stack or the requested service is not found
ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java