@Override
  public Integer setPrincipalPassword(String principal, String password, boolean service) throws KerberosOperationException {
    if (!isOpen()) {
      throw new KerberosOperationException("This operation handler has not been opened");
    }

    // It is expected that KerberosPrincipalDoesNotExistException is thrown if the principal does not exist.
    // The caller expects so that it can attempt to set the password for a principal without checking
    // to see if it exists first. If the principal does not exist and is required, the caller will
    // create it.  This saves a potentially unnecessary round trip to the KDC and back.
    if(!principalExists(principal, service)) {
      throw new KerberosPrincipalDoesNotExistException(String.format("Principal does not exist while attempting to set its password: %s", principal));
    }

    // This operation does nothing since a new key will be created when exporting the keytab file...
    return 0;
  }
Updates the password for an existing user principal in a previously configured IPA KDC
<p/>
This implementation creates a query to send to the ipa shell command and then interrogates
the exit code to determine if the operation executed successfully.

@param principal a String containing the principal to update
@param password  a String containing the password to set
@param service   a boolean value indicating whether the principal is for a service or not
@return an Integer declaring the new key number
@throws KerberosOperationException if an unexpected error occurred
ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KDCKerberosOperationHandler.java