public class ProgramOptions extends Object
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).
| Modifier and Type | Class and Description |
|---|---|
static class |
ProgramOptions.PasswordLocation |
| Modifier and Type | Field and Description |
|---|---|
static String |
AUTHTOKEN |
static String |
AUXINPUT |
static String |
DETACH |
static String |
ECHO |
static String |
HELP |
static String |
HOST |
static String |
INTERACTIVE |
static String |
NOTIFY |
static String |
PASSWORDFILE |
static String |
PORT |
static String |
SECURE |
static String |
TERSE |
static String |
USER |
| Constructor and Description |
|---|
ProgramOptions(Environment env)
Initialize program options based only on environment defaults,
with no options from the command line.
|
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.
|
ProgramOptions(ProgramOptions other)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAuthToken() |
String |
getAuxInput() |
String |
getClassName() |
String |
getClassPath() |
String |
getCommandName() |
static Collection<org.glassfish.api.admin.CommandModel.ParamModel> |
getHelpOption()
Return a set of all the valid program options.
|
String |
getHost() |
char[] |
getPassword() |
String |
getPasswordFile() |
ProgramOptions.PasswordLocation |
getPasswordLocation() |
String |
getPlainOption(String name)
Option by name just as was parsed.
|
int |
getPort() |
String[] |
getProgramArguments()
Return an array of asadmin command line options that specify
all the options of this ProgramOptions instance.
|
String |
getUser() |
static Collection<org.glassfish.api.admin.CommandModel.ParamModel> |
getValidOptions()
Return a set of all the valid program options.
|
boolean |
isDetachedCommand() |
boolean |
isEcho() |
boolean |
isHelp() |
boolean |
isInteractive() |
boolean |
isNotifyCommand() |
boolean |
isOptionsSet() |
boolean |
isSecure() |
boolean |
isTerse() |
void |
removeDetach() |
void |
setAuthToken(String token) |
void |
setAuxInput(String authInput) |
void |
setClassName(String className) |
void |
setClassPath(String classPath) |
void |
setCommandName(String commandName) |
void |
setEcho(boolean echo) |
void |
setHelp(boolean help) |
void |
setHost(String host) |
void |
setHostAndPort(com.sun.enterprise.util.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(char[] 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(org.glassfish.api.admin.ParameterMap newOptions)
Update the program options based on the specified
options from the command line.
|
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 DETACH
public static final String NOTIFY
public static final String AUTHTOKEN
public static final String AUXINPUT
public ProgramOptions(Environment env) throws org.glassfish.api.admin.CommandException
org.glassfish.api.admin.CommandExceptionpublic ProgramOptions(org.glassfish.api.admin.ParameterMap options,
Environment env)
throws org.glassfish.api.admin.CommandException
org.glassfish.api.admin.CommandExceptionpublic ProgramOptions(ProgramOptions other)
public final void updateOptions(org.glassfish.api.admin.ParameterMap newOptions)
throws org.glassfish.api.admin.CommandException
org.glassfish.api.admin.CommandExceptionpublic static Collection<org.glassfish.api.admin.CommandModel.ParamModel> getValidOptions()
public static Collection<org.glassfish.api.admin.CommandModel.ParamModel> getHelpOption()
public void toEnvironment(Environment env)
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(com.sun.enterprise.util.HostAndPort address)
address - the HostAndPort object from which to set the attributespublic String getUser()
public void setUser(String user)
user - the user to setpublic char[] getPassword()
public ProgramOptions.PasswordLocation getPasswordLocation()
public void setPassword(char[] 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()
public boolean isTerse()
public boolean isDetachedCommand()
public boolean isNotifyCommand()
public void removeDetach()
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 getPlainOption(String name)
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 getCommandName()
public void setCommandName(String commandName)
commandName - the name of the command (not the subcommand)Copyright © 2019. All rights reserved.