Package org.glassfish.common.util.admin
Class CommandModelImpl
- java.lang.Object
-
- org.glassfish.api.admin.CommandModel
-
- org.glassfish.common.util.admin.CommandModelImpl
-
public class CommandModelImpl extends CommandModel
Model for an administrative command- Author:
- Jerome Dochez
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.glassfish.api.admin.CommandModel
CommandModel.ParamModel
-
-
Constructor Summary
Constructors Constructor Description CommandModelImpl(Class<?> commandType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(CommandModel.ParamModel model)Add a ParamModel for this commandvoidaddParam(String name, CommandModel.ParamModel param)ExecuteOngetClusteringAttributes()Return the cluster parameters for this command or null if none are specified and defaults should be used.Class<?>getCommandClass()Return the class that defines the command.StringgetCommandName()Returns the command name as it is typed by the user.StringgetLocalizedDescription()Returns a localized description for this commandCommandModel.ParamModelgetModelFor(String paramName)Returns the parameter model for a particular parameterCollection<String>getParametersNames()Returns a collection of parameter names supported by this admininstrative commandStringgetUsageText()Returns a localized usage text for this command or null if the usage text should be generated from this model.static Map<String,CommandModel.ParamModel>init(Class commandType, I18n i18n, LocalStringManager localStrings)booleanisManagedJob()This command is managed job.voidsetManagedJob(boolean value)booleanunknownOptionsAreOperands()Should an unknown option be considered an operand by asadmin?-
Methods inherited from class org.glassfish.api.admin.CommandModel
getParameters, getParamName
-
-
-
-
Constructor Detail
-
CommandModelImpl
public CommandModelImpl(Class<?> commandType)
-
-
Method Detail
-
init
public static Map<String,CommandModel.ParamModel> init(Class commandType, I18n i18n, LocalStringManager localStrings)
-
getLocalizedDescription
public String getLocalizedDescription()
Description copied from class:CommandModelReturns a localized description for this command- Specified by:
getLocalizedDescriptionin classCommandModel- Returns:
- a localized displayable description
-
getUsageText
public String getUsageText()
Description copied from class:CommandModelReturns a localized usage text for this command or null if the usage text should be generated from this model.- Specified by:
getUsageTextin classCommandModel- Returns:
- the usage text
-
getCommandName
public String getCommandName()
Description copied from class:CommandModelReturns the command name as it is typed by the user.- Specified by:
getCommandNamein classCommandModel- Returns:
- the command name
-
getModelFor
public CommandModel.ParamModel getModelFor(String paramName)
Description copied from class:CommandModelReturns the parameter model for a particular parameter- Specified by:
getModelForin classCommandModel- Parameters:
paramName- the requested parameter model name- Returns:
- the parameter model if the command supports a parameter of the passed name or null if not.
-
getParametersNames
public Collection<String> getParametersNames()
Description copied from class:CommandModelReturns a collection of parameter names supported by this admininstrative command- Specified by:
getParametersNamesin classCommandModel- Returns:
- all the command's paramter names.
-
getCommandClass
public Class<?> getCommandClass()
Description copied from class:CommandModelReturn the class that defines the command. Normally this will be the class that provides the implementation of the command, but for generic CRUD commands it might be the config class that defines the command. The command class is used to locate resources related to the command, e.g., the command's man page. If the command model isn't associated with a command class, null is returned.- Specified by:
getCommandClassin classCommandModel- Returns:
- the command class, or null if none
-
getClusteringAttributes
public ExecuteOn getClusteringAttributes()
Description copied from class:CommandModelReturn the cluster parameters for this command or null if none are specified and defaults should be used.- Specified by:
getClusteringAttributesin classCommandModel- Returns:
- a
ExecuteOnannotation instance or null
-
isManagedJob
public boolean isManagedJob()
Description copied from class:CommandModelThis command is managed job. It is preferred to listen using SSE in case of remote execution.- Specified by:
isManagedJobin classCommandModel- Returns:
trueonly if command is @ManagedJob
-
setManagedJob
public void setManagedJob(boolean value)
-
unknownOptionsAreOperands
public boolean unknownOptionsAreOperands()
Should an unknown option be considered an operand by asadmin?- Overrides:
unknownOptionsAreOperandsin classCommandModel- Returns:
- true if unknown options are operands.
-
addParam
public void addParam(String name, CommandModel.ParamModel param)
-
add
public void add(CommandModel.ParamModel model)
Description copied from class:CommandModelAdd a ParamModel for this command- Specified by:
addin classCommandModel- Parameters:
model- the new param model to be added
-
-