public StackVersionResponse convertToResponse() {

    // Collect the services' Kerberos descriptor files
    Collection<ServiceInfo> serviceInfos = getServices();
    // The collection of service descriptor files. A Set is being used because some Kerberos descriptor
    // files contain multiple services, therefore the same File may be encountered more than once.
    // For example the YARN directory may contain YARN and MAPREDUCE2 services.
    Collection<File> serviceDescriptorFiles = new HashSet<>();
    if (serviceInfos != null) {
      for (ServiceInfo serviceInfo : serviceInfos) {
        File file = serviceInfo.getKerberosDescriptorFile();
        if (file != null) {
          serviceDescriptorFiles.add(file);
        }
      }
    }

    return new StackVersionResponse(getVersion(),
        isActive(), getParentStackVersion(), getConfigTypeAttributes(),
        serviceDescriptorFiles,
        null == upgradePacks ? Collections.emptySet() : upgradePacks.keySet(),
        isValid(), getErrors(), getMinJdk(), getMaxJdk());
  }
Set all types and associated attributes.  Any previously existing types and
attributes are removed prior to setting the new values.

@param types map of type attributes
ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java