public KerberosServiceDescriptor[] getKerberosDescriptor(ServiceInfo serviceInfo) throws AmbariException {

    KerberosServiceDescriptor[] kerberosServiceDescriptors = null;
    File kerberosFile = (serviceInfo == null) ? null : serviceInfo.getKerberosDescriptorFile();

    if (kerberosFile != null) {
      try {
        kerberosServiceDescriptors = kerberosServiceDescriptorFactory.createInstances(kerberosFile);
      } catch (Exception e) {
        LOG.error("Could not read the kerberos descriptor file", e);
        throw new AmbariException("Could not read kerberos descriptor file", e);
      }
    }

    return kerberosServiceDescriptors;
  }
Gets the requested service-level Kerberos descriptor(s)
<p/>
An array of descriptors are returned since the kerberos.json in a service directory may contain
descriptor details for one or more services.

@param serviceInfo a ServiceInfo declaring the stack name, version, a service (directory) name
                   details
@return an array of KerberosServiceDescriptors, or null if the relevant service (directory)
does not contain Kerberos descriptor details
@throws AmbariException if an error occurs reading or parsing the service's kerberos.json files
ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java