Class CommandModelImpl


  • public class CommandModelImpl
    extends CommandModel
    Model for an administrative command
    Author:
    Jerome Dochez
    • Constructor Detail

      • CommandModelImpl

        public CommandModelImpl​(Class<?> commandType)
    • Method Detail

      • getLocalizedDescription

        public String getLocalizedDescription()
        Description copied from class: CommandModel
        Returns a localized description for this command
        Specified by:
        getLocalizedDescription in class CommandModel
        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 class CommandModel
        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 class CommandModel
        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 class CommandModel
        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 class CommandModel
        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 class CommandModel
        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 class CommandModel
        Returns:
        a ExecuteOn annotation instance or null
      • 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 class CommandModel
        Returns:
        true only 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:
        unknownOptionsAreOperands in class CommandModel
        Returns:
        true if unknown options are operands.