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


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.
static String[] getLocalCommands(org.jvnet.hk2.component.Habitat habitat)
          Get all the known local commands.
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(ProgramOptions po, Environment env, 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
 

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

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(ProgramOptions po,
                                          Environment env,
                                          String[] args,
                                          int exit)
Log the command, for debugging.



Copyright © 2012. All Rights Reserved.