Package org.glassfish.api.admin
Class CommandModel
java.lang.Object
org.glassfish.api.admin.CommandModel
Model for an administrative command
- Author:
- Jerome Dochez
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Model for a command parameter. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
add
(CommandModel.ParamModel model) Add a ParamModel for this commandabstract ExecuteOn
Return the cluster parameters for this command or null if none are specified and defaults should be used.abstract Class
<?> Return the class that defines the command.abstract String
Returns the command name as it is typed by the user.abstract String
Returns a localized description for this commandabstract CommandModel.ParamModel
getModelFor
(String paramName) Returns the parameter model for a particular parameterReturns a collection of parameter model for all the parameters supported by this command.abstract Collection
<String> Returns a collection of parameter names supported by this admininstrative commandstatic String
getParamName
(Param param, AnnotatedElement annotated) Get the Param name.abstract String
Returns a localized usage text for this command or null if the usage text should be generated from this model.abstract boolean
This command is managed job.boolean
Should an unknown option be considered an operand by asadmin?
-
Constructor Details
-
CommandModel
public CommandModel()
-
-
Method Details
-
getCommandName
Returns the command name as it is typed by the user.- Returns:
- the command name
-
getLocalizedDescription
Returns a localized description for this command- Returns:
- a localized displayable description
-
getUsageText
Returns a localized usage text for this command or null if the usage text should be generated from this model.- Returns:
- the usage text
-
getModelFor
Returns the parameter model for a particular parameter- 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
Returns a collection of parameter names supported by this admininstrative command- Returns:
- all the command's paramter names.
-
getCommandClass
Return 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.- Returns:
- the command class, or null if none
-
isManagedJob
public abstract boolean isManagedJob()This command is managed job. It is preferred to listen using SSE in case of remote execution.- Returns:
true
only if command is @ManagedJob
-
getClusteringAttributes
Return the cluster parameters for this command or null if none are specified and defaults should be used.- Returns:
- a
ExecuteOn
annotation instance or null
-
add
Add a ParamModel for this command- Parameters:
model
- the new param model to be added
-
getParameters
Returns a collection of parameter model for all the parameters supported by this command.- Returns:
- the command's parameters models.
-
getParamName
Get the Param name. First it checks if the annotated Param includes a name, if not then it gets the name from the field. If the parameter is a password, add the prefix and change the name to upper case.- Parameters:
param
- class annotationannotated
- annotated field or method- Returns:
- the name of the param
-
unknownOptionsAreOperands
public boolean unknownOptionsAreOperands()Should an unknown option be considered an operand by asadmin?- Returns:
- true if unknown options are operands.
-