|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.admin.cli.ProgramOptions
public class ProgramOptions
Representation of the options known to the asadmin program. These options control the overall behavior of asadmin, e.g., the server to contact, and aren't specific to any of the commands supported by asadmin.
In GlassFish v3, asadmin program options are normally specified before the asadmin command name, with command options after the command name (although intermixed program and command options are still supported for compatibility).
| Nested Class Summary | |
|---|---|
static class |
ProgramOptions.PasswordLocation
|
| Field Summary | |
|---|---|
static String |
AUTHTOKEN
|
static String |
AUXINPUT
|
private String |
className
|
private String |
classPath
|
static String |
ECHO
|
private Environment |
env
|
static String |
HELP
|
static String |
HOST
|
static String |
INTERACTIVE
|
private ProgramOptions.PasswordLocation |
location
|
private static Logger |
logger
|
private ParameterMap |
options
|
private boolean |
optionsSet
|
private String |
password
|
static String |
PASSWORDFILE
|
static String |
PORT
|
private static Set<CommandModel.ParamModel> |
programOptions
|
static String |
SECURE
|
private static LocalStringsImpl |
strings
|
static String |
TERSE
|
static String |
USER
|
| Constructor Summary | |
|---|---|
ProgramOptions(Environment env)
Initialize program options based only on environment defaults, with no options from the command line. |
|
ProgramOptions(ParameterMap options,
Environment env)
Initialize the programoptions based on parameters parsed from the command line, with defaults supplied by the environment. |
|
ProgramOptions(ProgramOptions other)
Copy constructor. |
|
| Method Summary | |
|---|---|
private static void |
addMetaOption(Set<CommandModel.ParamModel> opts,
String name,
char sname,
Class type,
boolean req,
String def)
Helper method to define a meta-option. |
String |
getAuthToken()
|
String |
getAuxInput()
|
String |
getClassName()
|
String |
getClassPath()
|
String |
getHost()
|
String |
getPassword()
|
String |
getPasswordFile()
|
ProgramOptions.PasswordLocation |
getPasswordLocation()
|
int |
getPort()
|
String[] |
getProgramArguments()
Return an array of asadmin command line options that specify all the options of this ProgramOptions instance. |
private String |
getString(String optionName)
|
String |
getUser()
|
static Collection<CommandModel.ParamModel> |
getValidOptions()
Return a set of all the valid program options. |
boolean |
isEcho()
|
boolean |
isHelp()
|
boolean |
isInteractive()
|
boolean |
isOptionsSet()
|
boolean |
isSecure()
|
boolean |
isTerse()
|
private static boolean |
ok(String s)
|
private void |
putEnv(Environment env,
String name)
|
void |
setAuthToken(String token)
|
void |
setAuxInput(String authInput)
|
void |
setClassName(String className)
|
void |
setClassPath(String classPath)
|
void |
setEcho(boolean echo)
|
void |
setHelp(boolean help)
|
void |
setHost(String host)
|
void |
setHostAndPort(HostAndPort address)
Convenience method to set the host and port (and secure) attributes from a HostAndPort object. |
void |
setInteractive(boolean interactive)
|
void |
setOptionsSet(boolean optionsSet)
Set whether the program options have already been set. |
void |
setPassword(String password,
ProgramOptions.PasswordLocation location)
|
void |
setPasswordFile(String passwordFile)
|
void |
setPort(int port)
|
void |
setSecure(boolean secure)
|
void |
setTerse(boolean terse)
|
void |
setUser(String user)
|
void |
toEnvironment(Environment env)
Copy the program options that were specified on the command line into the corresponding environment variables. |
String |
toString()
String representation of the asadmin program options. |
void |
updateOptions(ParameterMap newOptions)
Update the program options based on the specified options from the command line. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final Set<CommandModel.ParamModel> programOptions
public static final String HOST
public static final String PORT
public static final String USER
public static final String PASSWORDFILE
public static final String TERSE
public static final String ECHO
public static final String INTERACTIVE
public static final String SECURE
public static final String HELP
public static final String AUTHTOKEN
public static final String AUXINPUT
private static final Logger logger
private static final LocalStringsImpl strings
private ParameterMap options
private Environment env
private boolean optionsSet
private String password
private ProgramOptions.PasswordLocation location
private String classPath
private String className
| Constructor Detail |
|---|
public ProgramOptions(Environment env)
throws CommandException
CommandException
public ProgramOptions(ParameterMap options,
Environment env)
throws CommandException
CommandExceptionpublic ProgramOptions(ProgramOptions other)
| Method Detail |
|---|
private static void addMetaOption(Set<CommandModel.ParamModel> opts,
String name,
char sname,
Class type,
boolean req,
String def)
name - long option namesname - short option nametype - option type (String.class, Boolean.class, etc.)req - is option required?def - default value for option
public void updateOptions(ParameterMap newOptions)
throws CommandException
CommandExceptionprivate static boolean ok(String s)
public static Collection<CommandModel.ParamModel> getValidOptions()
public void toEnvironment(Environment env)
private void putEnv(Environment env,
String name)
public String getHost()
public void setHost(String host)
host - the host to setpublic int getPort()
public void setPort(int port)
port - the port to setpublic void setHostAndPort(HostAndPort address)
address - the HostAndPort object from which to set the attributespublic String getUser()
public void setUser(String user)
user - the user to setpublic String getPassword()
public ProgramOptions.PasswordLocation getPasswordLocation()
public void setPassword(String password,
ProgramOptions.PasswordLocation location)
password - the password to setpublic String getPasswordFile()
public void setPasswordFile(String passwordFile)
passwordFile - the passwordFile to setpublic boolean isSecure()
public void setSecure(boolean secure)
secure - the secure to setpublic void setAuthToken(String token)
public String getAuthToken()
public void setAuxInput(String authInput)
public String getAuxInput()
private String getString(String optionName)
public boolean isTerse()
public void setTerse(boolean terse)
terse - the terse to setpublic boolean isEcho()
public void setEcho(boolean echo)
echo - the echo to setpublic boolean isInteractive()
public void setInteractive(boolean interactive)
interactive - the interactive to setpublic boolean isHelp()
public void setHelp(boolean help)
help - the help to setpublic boolean isOptionsSet()
public void setOptionsSet(boolean optionsSet)
public String[] getProgramArguments()
public String getClassPath()
public void setClassPath(String classPath)
classPath - the classPath to setpublic String getClassName()
public void setClassName(String className)
className - the className to setpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||