|
||||||||||
| 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 java.lang.String |
AUTHTOKEN
|
static java.lang.String |
AUXINPUT
|
private java.lang.String |
className
|
private java.lang.String |
classPath
|
static java.lang.String |
ECHO
|
private Environment |
env
|
static java.lang.String |
HELP
|
static java.lang.String |
HOST
|
static java.lang.String |
INTERACTIVE
|
private ProgramOptions.PasswordLocation |
location
|
private static java.util.logging.Logger |
logger
|
private ParameterMap |
options
|
private boolean |
optionsSet
|
private java.lang.String |
password
|
static java.lang.String |
PASSWORDFILE
|
static java.lang.String |
PORT
|
private static java.util.Set<CommandModel.ParamModel> |
programOptions
|
static java.lang.String |
SECURE
|
private static LocalStringsImpl |
strings
|
static java.lang.String |
TERSE
|
static java.lang.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(java.util.Set<CommandModel.ParamModel> opts,
java.lang.String name,
char sname,
java.lang.Class type,
boolean req,
java.lang.String def)
Helper method to define a meta-option. |
java.lang.String |
getAuthToken()
|
java.lang.String |
getAuxInput()
|
java.lang.String |
getClassName()
|
java.lang.String |
getClassPath()
|
java.lang.String |
getHost()
|
java.lang.String |
getPassword()
|
java.lang.String |
getPasswordFile()
|
ProgramOptions.PasswordLocation |
getPasswordLocation()
|
int |
getPort()
|
java.lang.String[] |
getProgramArguments()
Return an array of asadmin command line options that specify all the options of this ProgramOptions instance. |
private java.lang.String |
getString(java.lang.String optionName)
|
java.lang.String |
getUser()
|
static java.util.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(java.lang.String s)
|
private void |
putEnv(Environment env,
java.lang.String name)
|
void |
setAuthToken(java.lang.String token)
|
void |
setAuxInput(java.lang.String authInput)
|
void |
setClassName(java.lang.String className)
|
void |
setClassPath(java.lang.String classPath)
|
void |
setEcho(boolean echo)
|
void |
setHelp(boolean help)
|
void |
setHost(java.lang.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(java.lang.String password,
ProgramOptions.PasswordLocation location)
|
void |
setPasswordFile(java.lang.String passwordFile)
|
void |
setPort(int port)
|
void |
setSecure(boolean secure)
|
void |
setTerse(boolean terse)
|
void |
setUser(java.lang.String user)
|
void |
toEnvironment(Environment env)
Copy the program options that were specified on the command line into the corresponding environment variables. |
java.lang.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 java.util.Set<CommandModel.ParamModel> programOptions
public static final java.lang.String HOST
public static final java.lang.String PORT
public static final java.lang.String USER
public static final java.lang.String PASSWORDFILE
public static final java.lang.String TERSE
public static final java.lang.String ECHO
public static final java.lang.String INTERACTIVE
public static final java.lang.String SECURE
public static final java.lang.String HELP
public static final java.lang.String AUTHTOKEN
public static final java.lang.String AUXINPUT
private static final java.util.logging.Logger logger
private static final LocalStringsImpl strings
private ParameterMap options
private Environment env
private boolean optionsSet
private java.lang.String password
private ProgramOptions.PasswordLocation location
private java.lang.String classPath
private java.lang.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(java.util.Set<CommandModel.ParamModel> opts,
java.lang.String name,
char sname,
java.lang.Class type,
boolean req,
java.lang.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(java.lang.String s)
public static java.util.Collection<CommandModel.ParamModel> getValidOptions()
public void toEnvironment(Environment env)
private void putEnv(Environment env,
java.lang.String name)
public java.lang.String getHost()
public void setHost(java.lang.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 java.lang.String getUser()
public void setUser(java.lang.String user)
user - the user to setpublic java.lang.String getPassword()
public ProgramOptions.PasswordLocation getPasswordLocation()
public void setPassword(java.lang.String password,
ProgramOptions.PasswordLocation location)
password - the password to setpublic java.lang.String getPasswordFile()
public void setPasswordFile(java.lang.String passwordFile)
passwordFile - the passwordFile to setpublic boolean isSecure()
public void setSecure(boolean secure)
secure - the secure to setpublic void setAuthToken(java.lang.String token)
public java.lang.String getAuthToken()
public void setAuxInput(java.lang.String authInput)
public java.lang.String getAuxInput()
private java.lang.String getString(java.lang.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 java.lang.String[] getProgramArguments()
public java.lang.String getClassPath()
public void setClassPath(java.lang.String classPath)
classPath - the classPath to setpublic java.lang.String getClassName()
public void setClassName(java.lang.String className)
className - the className to setpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||