public SecurityConfiguration loadSecurityConfigurationByReference(String reference) {
    SecurityConfiguration securityConfiguration;
    LOGGER.debug("Loading security configuration by reference: {}", reference);

    if (reference == null) {
      LOGGER.error("No security configuration reference provided!");
      throw new IllegalArgumentException("No security configuration reference provided!");
    }

    KerberosDescriptorEntity descriptorEntity = kerberosDescriptorDAO.findByName(reference);

    if (descriptorEntity == null) {
      LOGGER.error("No security configuration found for the reference: {}", reference);
      throw new IllegalArgumentException("No security configuration found for the reference: " + reference);
    }

    String descriptorText = descriptorEntity.getKerberosDescriptorText();
    Map<String, ?> descriptorMap = jsonSerializer.<Map<String, ?>>fromJson(descriptorText, Map.class);
    securityConfiguration =  SecurityConfiguration.withDescriptor(descriptorMap);

    return securityConfiguration;

  }
Creates and also validates SecurityConfiguration based on properties parsed from request Json.

@param properties Security properties from Json parsed into a Map
@param persistEmbeddedDescriptor whether to save embedded descriptor or not
ambari-server/src/main/java/org/apache/ambari/server/topology/SecurityConfigurationFactory.java