@Override
    public int execute() throws Exception {
      int exitCode;
      List<String> args = new ArrayList<>();

      args.add("list");

      String[] toolArgs = args.toArray(new String[args.size()]);

      exitCode = ToolRunner.run(getConf(), new CredentialShell(), toolArgs);

      return exitCode;
    }
Executes the list command.

@return - 0 if successful; 1 otherwise.
@throws Exception - If something goes wrong.
ambari-server/src/main/java/org/apache/ambari/server/credentialapi/CredentialUtil.java