public static KerberosDescriptor updateUserKerberosDescriptor(KerberosDescriptor beginningStackKerberosDescriptor,
                                                                KerberosDescriptor endingStackKerberosDescriptor,
                                                                KerberosDescriptor userKerberosDescriptor) {
    KerberosDescriptor updated = new KerberosDescriptor(userKerberosDescriptor.toMap());

    updated.setProperties(processProperties(
        beginningStackKerberosDescriptor.getProperties(),
        endingStackKerberosDescriptor.getProperties(),
        updated.getProperties()));

    updated.setConfigurations(processConfigurations(
        beginningStackKerberosDescriptor.getConfigurations(),
        endingStackKerberosDescriptor.getConfigurations(),
        updated.getConfigurations()));

    updated.setIdentities(processIdentities(
        beginningStackKerberosDescriptor.getIdentities(),
        endingStackKerberosDescriptor.getIdentities(),
        updated.getIdentities()));

    updated.setAuthToLocalProperties(processAuthToLocalProperties(
        beginningStackKerberosDescriptor.getAuthToLocalProperties(),
        endingStackKerberosDescriptor.getAuthToLocalProperties(),
        updated.getAuthToLocalProperties()));

    updated.setServices(processServices(
        beginningStackKerberosDescriptor.getServices(),
        endingStackKerberosDescriptor.getServices(),
        updated.getServices()));

    return updated;
  }
The entry point into upgrading a user-specified Kerberos descriptor.
<p>
The supplied Kerberos descriptors will remain untouched and new Kerberos descriptor instance will
created and returned with the update data.

@param beginningStackKerberosDescriptor the Kerberos descriptor for the previous stack version
@param endingStackKerberosDescriptor    the Kerberos descriptor for the new stack version
@param userKerberosDescriptor           the user-specified Kerberos descriptor
@return a new Kerberos descriptor containing the updated user-specified data
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorUpdateHelper.java