com.sun.enterprise.admin.cli
Class CLIUtil

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

public class CLIUtil
extends Object

CLI Utility class


Field Summary
private static int MAX_COMMANDS_TO_DISPLAY
           
private static LocalStringsImpl strings
           
 
Constructor Summary
CLIUtil()
           
 
Method Summary
static void displayClosestMatch(String commandName, String[] commands, String msg, Logger logger)
          Display the commands from the list that are the closest match to the specified command.
static String[] getAllCommands(org.jvnet.hk2.component.Habitat habitat, ProgramOptions po, Environment env)
          Return all commands, local and remote.
private static File getDebugLogfile()
           
static String[] getLocalCommands(org.jvnet.hk2.component.Habitat habitat)
          Get all the known local commands.
private static String[] getMatchedCommands(String pattern, String[] commands)
          Return all the commands that include pattern (just a literal string, not really a pattern) as a substring.
static String[] getRemoteCommands(org.jvnet.hk2.component.Habitat habitat, ProgramOptions po, Environment env)
          Get the list of commands from the remote server.
static Map<String,String> readPasswordFileOptions(String passwordFileName, boolean withPrefix)
          Read passwords from the password file and save them in a java.util.Map.
static void writeCommandToDebugLog(String[] args, int exit)
          Log the command, for debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_COMMANDS_TO_DISPLAY

private static final int MAX_COMMANDS_TO_DISPLAY
See Also:
Constant Field Values

strings

private static final LocalStringsImpl strings
Constructor Detail

CLIUtil

public CLIUtil()
Method Detail

readPasswordFileOptions

public static Map<String,String> readPasswordFileOptions(String passwordFileName,
                                                         boolean withPrefix)
                                                  throws 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:
CommandException

displayClosestMatch

public static void displayClosestMatch(String commandName,
                                       String[] commands,
                                       String msg,
                                       Logger logger)
                                throws InvalidCommandException
Display the commands from the list that are the closest match to the specified command.

Throws:
InvalidCommandException

getMatchedCommands

private static String[] getMatchedCommands(String pattern,
                                           String[] commands)
Return all the commands that include pattern (just a literal string, not really a pattern) as a substring.


getAllCommands

public static String[] getAllCommands(org.jvnet.hk2.component.Habitat habitat,
                                      ProgramOptions po,
                                      Environment env)
Return all commands, local and remote.

Returns:
the commands as a String array, sorted

getLocalCommands

public static String[] getLocalCommands(org.jvnet.hk2.component.Habitat habitat)
Get all the known local commands.

Returns:
the commands as a String array, sorted

getRemoteCommands

public static String[] getRemoteCommands(org.jvnet.hk2.component.Habitat habitat,
                                         ProgramOptions po,
                                         Environment env)
                                  throws CommandException,
                                         CommandValidationException
Get the list of commands from the remote server.

Returns:
the commands as a String array, sorted
Throws:
CommandException
CommandValidationException

writeCommandToDebugLog

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


getDebugLogfile

private static File getDebugLogfile()


Copyright © 2012 GlassFish Community. All Rights Reserved.