Package org.glassfish.common.util.admin
Class GenericCommandModel
- java.lang.Object
-
- org.glassfish.api.admin.CommandModel
-
- org.glassfish.common.util.admin.GenericCommandModel
-
public class GenericCommandModel extends CommandModel
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.glassfish.api.admin.CommandModel
CommandModel.ParamModel
-
-
Constructor Summary
Constructors Constructor Description GenericCommandModel(Class<?> targetType, boolean useAnnotations, ExecuteOn cluster, I18n i18n, LocalStringManager localStrings, DomDocument document, String commandName, boolean managedJob, Class<?>... extraTypes)
GenericCommandModel constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(CommandModel.ParamModel model)
Add a ParamModel for this commandExecuteOn
getClusteringAttributes()
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.String
getCommandName()
Returns the command name as it is typed by the user.String
getLocalizedDescription()
Returns a localized description for this commandCommandModel.ParamModel
getModelFor(String paramName)
Returns the parameter model for a particular parameterCollection<String>
getParametersNames()
Returns a collection of parameter names supported by this admininstrative commandString
getUsageText()
Returns a localized usage text for this command or null if the usage text should be generated from this model.boolean
isManagedJob()
This command is managed job.-
Methods inherited from class org.glassfish.api.admin.CommandModel
getParameters, getParamName, unknownOptionsAreOperands
-
-
-
-
Constructor Detail
-
GenericCommandModel
public GenericCommandModel(Class<?> targetType, boolean useAnnotations, ExecuteOn cluster, I18n i18n, LocalStringManager localStrings, DomDocument document, String commandName, boolean managedJob, Class<?>... extraTypes)
GenericCommandModel constructor.- Parameters:
targetType
- the ConfigBeanProxy class that may have additional @Param annotations for the command,useAnnotations
- if true, use the annotations on the targetType class to define the parameterscluster
- the @ExecuteOn annotation, if anyi18n
- the @I18n annotation, if anylocalStrings
- where to find strings for the commanddocument
- the DomDocument for the commandcommandName
- the name of the commandsupportsProgress
-true
only if command working with ProgressStatusextraTypes
- any extra types that might also define parameters for the command
-
-
Method Detail
-
getLocalizedDescription
public String getLocalizedDescription()
Description copied from class:CommandModel
Returns a localized description for this command- Specified by:
getLocalizedDescription
in classCommandModel
- Returns:
- a localized displayable description
-
getUsageText
public String getUsageText()
Description copied from class:CommandModel
Returns a localized usage text for this command or null if the usage text should be generated from this model.- Specified by:
getUsageText
in classCommandModel
- Returns:
- the usage text
-
getCommandName
public String getCommandName()
Description copied from class:CommandModel
Returns the command name as it is typed by the user.- Specified by:
getCommandName
in classCommandModel
- Returns:
- the command name
-
getModelFor
public CommandModel.ParamModel getModelFor(String paramName)
Description copied from class:CommandModel
Returns the parameter model for a particular parameter- Specified by:
getModelFor
in 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:CommandModel
Returns a collection of parameter names supported by this admininstrative command- Specified by:
getParametersNames
in classCommandModel
- Returns:
- all the command's paramter names.
-
getCommandClass
public Class<?> getCommandClass()
Description copied from class:CommandModel
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.- Specified by:
getCommandClass
in classCommandModel
- Returns:
- the command class, or null if none
-
getClusteringAttributes
public ExecuteOn getClusteringAttributes()
Description copied from class:CommandModel
Return the cluster parameters for this command or null if none are specified and defaults should be used.- Specified by:
getClusteringAttributes
in classCommandModel
- Returns:
- a
ExecuteOn
annotation instance or null
-
add
public void add(CommandModel.ParamModel model)
Description copied from class:CommandModel
Add a ParamModel for this command- Specified by:
add
in classCommandModel
- Parameters:
model
- the new param model to be added
-
isManagedJob
public boolean isManagedJob()
Description copied from class:CommandModel
This command is managed job. It is preferred to listen using SSE in case of remote execution.- Specified by:
isManagedJob
in classCommandModel
- Returns:
true
only if command is @ManagedJob
-
-