private void validateServiceProperties() {
    // Verify if there are duplicate service properties by name
    Multimap<String, ServicePropertyInfo> servicePropsByName = Multimaps.index(
        getServicePropertyList(),
        new Function<ServicePropertyInfo, String>() {
          @Override
          public String apply(ServicePropertyInfo servicePropertyInfo) {
            return servicePropertyInfo.getName();
          }
        }

    );

    for (String propertyName : servicePropsByName.keySet()) {
      if (servicePropsByName.get(propertyName).size() > 1) {
        setValid(false);
        addError("Duplicate service property with name '" + propertyName + "' found in " + getName() + ":" + getVersion() + " service definition !");
      }
    }

    for (ComponentInfo component : getComponents()) {
      int primaryLogs = 0;
      for (LogDefinition log : component.getLogs()) {
        primaryLogs += log.isPrimary() ? 1 : 0;
      }

      if (primaryLogs > 1) {
        setValid(false);
        addError("More than one primary log exists for the component " + component.getName());
      }
    }

    // validate credential store information
    if (credentialStoreInfo != null) {
      // if both are specified, supported must be true if enabled is false or true.
      if (credentialStoreInfo.isSupported() != null && credentialStoreInfo.isEnabled() != null) {
        if (!credentialStoreInfo.isSupported() && credentialStoreInfo.isEnabled()) {
          setValid(false);
          addError("Credential store cannot be enabled for service " + getName() + " as it does not support it.");
        }
      }

      // Must be specified
      if (credentialStoreInfo.isSupported() == null) {
        setValid(false);
        addError("Credential store supported is not specified for service " + getName());
      }

      // Must be specified
      if (credentialStoreInfo.isEnabled() == null) {
        setValid(false);
        addError("Credential store enabled is not specified for service " + getName());
      }
    }

    // validate single sign-in support information
    if (singleSignOnInfo != null) {
      if (singleSignOnInfo.isSupported()) {
        if (StringUtils.isEmpty(singleSignOnInfo.getSsoEnabledTest()) && StringUtils.isEmpty(singleSignOnInfo.getEnabledConfiguration())) {
          setValid(false);
          addError("Single Sign-on support is indicated for service " + getName() + " but no test configuration has been set (enabledConfiguration or ssoEnabledTest).");
        }
      }
    }

    if (ldapInfo != null && ldapInfo.isSupported() && StringUtils.isBlank(ldapInfo.getLdapEnabledTest())) {
      setValid(false);
      addError("LDAP support is indicated for service " + getName() + " but no test configuration has been set by ldapEnabledTest.");
    }
  }
Constructs the map that stores the service properties defined in the xml service definition.
The keys are the property names and values the property values.
It ensures that missing required service properties are added with default values.
ambari-server/src/main/java/org/apache/ambari/server/state/ServiceInfo.java