private ShellCommandUtil.Result invokeIpa(String[] query) throws KerberosOperationException {

    if ((query == null) || (query.length == 0)) {
      throw new KerberosOperationException("Missing ipa query");
    }

    if (StringUtils.isEmpty(executableIpa)) {
      throw new KerberosOperationException("No path for ipa is available - this KerberosOperationHandler may not have been opened.");
    }

    String[] command = new String[query.length + 1];
    command[0] = executableIpa;
    System.arraycopy(query, 0, command, 1, query.length);

    ShellCommandUtil.Result result = executeCommand(command);

    if (result.isSuccessful()) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("Executed the following command:\n{}\nSTDOUT: {}\nSTDERR: {}",
            StringUtils.join(command, " "), result.getStdout(), result.getStderr());
      }
    } else {
      LOG.error("Failed to execute the following command:\n{}\nSTDOUT: {}\nSTDERR: {}",
          StringUtils.join(command, " "), result.getStdout(), result.getStderr());
    }

    return result;
  }
Invokes the ipa shell command with administrative credentials to issue queries

@param query a String containing the query to send to the ipa command
@return a ShellCommandUtil.Result containing the result of the operation
@throws KerberosOperationException if an unexpected error occurred
ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/IPAKerberosOperationHandler.java