Package com.sun.enterprise.admin.cli
Class ProgramOptions
java.lang.Object
com.sun.enterprise.admin.cli.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
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInitialize program options based only on environment defaults, with no options from the command line.ProgramOptions(ProgramOptions other) Copy constructor.ProgramOptions(org.glassfish.api.admin.ParameterMap options, Environment env) Initialize the programoptions based on parameters parsed from the command line, with defaults supplied by the environment. -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<org.glassfish.api.admin.CommandModel.ParamModel>Return a set of all the valid program options.getHost()char[]getPlainOption(String name) Option by name just as was parsed.intgetPort()String[]Return an array of asadmin command line options that specify all the options of this ProgramOptions instance.getUser()static Collection<org.glassfish.api.admin.CommandModel.ParamModel>Return a set of all the valid program options.booleanbooleanisEcho()booleanisHelp()booleanbooleanbooleanbooleanisSecure()booleanisTerse()voidvoidsetAuthToken(String token) voidsetAuxInput(String authInput) voidsetClassName(String className) voidsetClassPath(String classPath) voidsetCommandName(String commandName) voidsetEcho(boolean echo) voidsetHelp(boolean help) voidvoidsetHostAndPort(com.sun.enterprise.util.HostAndPort address) Convenience method to set the host and port (and secure) attributes from a HostAndPort object.voidsetInteractive(boolean interactive) voidsetOptionsSet(boolean optionsSet) Set whether the program options have already been set.voidsetPassword(char[] password, ProgramOptions.PasswordLocation location) voidsetPasswordFile(String passwordFile) voidsetPort(int port) voidsetSecure(boolean secure) voidsetTerse(boolean terse) voidvoidtoEnvironment(Environment env) Copy the program options that were specified on the command line into the corresponding environment variables.toString()String representation of the asadmin program options.final voidupdateOptions(org.glassfish.api.admin.ParameterMap newOptions) Update the program options based on the specified options from the command line.
-
Field Details
-
HOST
- See Also:
-
PORT
- See Also:
-
USER
- See Also:
-
PASSWORDFILE
- See Also:
-
TERSE
- See Also:
-
ECHO
- See Also:
-
INTERACTIVE
- See Also:
-
SECURE
- See Also:
-
HELP
- See Also:
-
DETACH
- See Also:
-
NOTIFY
- See Also:
-
AUTHTOKEN
- See Also:
-
AUXINPUT
- See Also:
-
-
Constructor Details
-
ProgramOptions
Initialize program options based only on environment defaults, with no options from the command line.- Throws:
org.glassfish.api.admin.CommandException
-
ProgramOptions
public ProgramOptions(org.glassfish.api.admin.ParameterMap options, Environment env) throws org.glassfish.api.admin.CommandException Initialize the programoptions based on parameters parsed from the command line, with defaults supplied by the environment.- Throws:
org.glassfish.api.admin.CommandException
-
ProgramOptions
Copy constructor. Create a new ProgramOptions with the same options as the specified ProgramOptions.
-
-
Method Details
-
updateOptions
public final void updateOptions(org.glassfish.api.admin.ParameterMap newOptions) throws org.glassfish.api.admin.CommandException Update the program options based on the specified options from the command line.- Throws:
org.glassfish.api.admin.CommandException
-
getValidOptions
Return a set of all the valid program options.- Returns:
- the valid program options
-
getHelpOption
Return a set of all the valid program options.- Returns:
- the valid program options
-
toEnvironment
Copy the program options that were specified on the command line into the corresponding environment variables. -
getHost
- Returns:
- the host
-
setHost
- Parameters:
host- the host to set
-
getPort
public int getPort()- Returns:
- the port
-
setPort
public void setPort(int port) - Parameters:
port- the port to set
-
setHostAndPort
public void setHostAndPort(com.sun.enterprise.util.HostAndPort address) Convenience method to set the host and port (and secure) attributes from a HostAndPort object.- Parameters:
address- the HostAndPort object from which to set the attributes
-
getUser
- Returns:
- the user
-
setUser
- Parameters:
user- the user to set
-
getPassword
public char[] getPassword()- Returns:
- the password
-
getPasswordLocation
- Returns:
- the password location
-
setPassword
- Parameters:
password- the password to set
-
getPasswordFile
- Returns:
- the passwordFile
-
setPasswordFile
- Parameters:
passwordFile- the passwordFile to set
-
isSecure
public boolean isSecure()- Returns:
- the secure
-
setSecure
public void setSecure(boolean secure) - Parameters:
secure- the secure to set
-
setAuthToken
-
getAuthToken
-
setAuxInput
-
getAuxInput
-
isTerse
public boolean isTerse()- Returns:
- the terse
-
isDetachedCommand
public boolean isDetachedCommand()- Returns:
- detach option
-
isNotifyCommand
public boolean isNotifyCommand()- Returns:
- notify option
-
removeDetach
public void removeDetach() -
setTerse
public void setTerse(boolean terse) - Parameters:
terse- the terse to set
-
isEcho
public boolean isEcho()- Returns:
- the echo
-
setEcho
public void setEcho(boolean echo) - Parameters:
echo- the echo to set
-
isInteractive
public boolean isInteractive()- Returns:
- the interactive
-
setInteractive
public void setInteractive(boolean interactive) - Parameters:
interactive- the interactive to set
-
isHelp
public boolean isHelp()- Returns:
- the help
-
setHelp
public void setHelp(boolean help) - Parameters:
help- the help to set
-
isOptionsSet
public boolean isOptionsSet()- Returns:
- were options set on the command line?
-
setOptionsSet
public void setOptionsSet(boolean optionsSet) Set whether the program options have already been set. -
getProgramArguments
Return an array of asadmin command line options that specify all the options of this ProgramOptions instance. -
getPlainOption
Option by name just as was parsed. No added value. -
getClassPath
- Returns:
- the classPath
-
setClassPath
- Parameters:
classPath- the classPath to set
-
getClassName
- Returns:
- the className
-
setClassName
- Parameters:
className- the className to set
-
getCommandName
- Returns:
- the name of the command (not the subcommand)
-
setCommandName
- Parameters:
commandName- the name of the command (not the subcommand)
-
toString
String representation of the asadmin program options. Included in the --echo output.
-