Package com.sun.enterprise.admin.cli
Class CLIUtil
- java.lang.Object
-
- com.sun.enterprise.admin.cli.CLIUtil
-
public class CLIUtil extends Object
CLI Utility class
-
-
Constructor Summary
Constructors Constructor Description CLIUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddisplayClosestMatch(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(CLIContainer container, ProgramOptions po, Environment env)Return all commands, local and remote.static String[]getLocalCommands(CLIContainer container)Get all the known local commands.static String[]getRemoteCommands(CLIContainer container, 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 voidwriteCommandToDebugLog(String cname, Environment env, String[] args, int exit)Log the command, for debugging.
-
-
-
Method Detail
-
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 namewithPrefix- 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.CommandExceptionorg.glassfish.api.admin.CommandValidationException
-
writeCommandToDebugLog
public static void writeCommandToDebugLog(String cname, Environment env, String[] args, int exit)
Log the command, for debugging.
-
-