Class CLIUtil

java.lang.Object
com.sun.enterprise.admin.cli.CLIUtil

public class CLIUtil extends Object
CLI Utility class
  • Constructor Details

    • CLIUtil

      public CLIUtil()
  • Method Details

    • readPasswordFileOptions

      public static Map<String,String> readPasswordFileOptions(String passwordFileName, boolean withPrefix) throws org.glassfish.api.admin.CommandException
      Read passwords from the password file and save them in a java.util.Map.
      Parameters:
      passwordFileName - password file name
      withPrefix - decides whether prefix should be taken into account
      Returns:
      Map of the password name and value
      Throws:
      org.glassfish.api.admin.CommandException
    • displayClosestMatch

      public static void displayClosestMatch(String commandName, String[] commands, String msg, Logger logger) throws org.glassfish.api.admin.InvalidCommandException
      Display the commands from the list that are the closest match to the specified command.
      Throws:
      org.glassfish.api.admin.InvalidCommandException
    • getAllCommands

      public static String[] getAllCommands(CLIContainer container, ProgramOptions po, Environment env)
      Return all commands, local and remote.
      Returns:
      the commands as a String array, sorted
    • getLocalCommands

      public static String[] getLocalCommands(CLIContainer container)
      Get all the known local commands.
      Returns:
      the commands as a String array, sorted
    • getRemoteCommands

      public static String[] getRemoteCommands(CLIContainer container, ProgramOptions po, Environment env) throws org.glassfish.api.admin.CommandException, org.glassfish.api.admin.CommandValidationException
      Get the list of commands from the remote server.
      Returns:
      the commands as a String array, sorted
      Throws:
      org.glassfish.api.admin.CommandException
      org.glassfish.api.admin.CommandValidationException
    • writeCommandToDebugLog

      public static void writeCommandToDebugLog(String cname, Environment env, String[] args, int exit)
      Log the command, for debugging.