Package org.glassfish.api.admin
Interface CommandRunner
-
- All Known Implementing Classes:
CommandRunnerImpl
@Contract public interface CommandRunner
CommandRunner is a service that allows you to run administrative commands.- Author:
- Jerome Dochez
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
CommandRunner.CommandInvocation
CommandInvocation defines a command excecution context like the requested name of the command to execute, the parameters of the command, etc...
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ActionReport
getActionReport(String name)
Returns an initialized ActionReport instance for the passed type or null if it cannot be found.AdminCommand
getCommand(String scope, String commandName, ActionReport report, Logger logger)
Obtain and return the command implementation defined by the passed commandNameAdminCommand
getCommand(String commandName, ActionReport report, Logger logger)
Obtain and return the command implementation defined by the passed commandName for the null scopeCommandRunner.CommandInvocation
getCommandInvocation(String scope, String name, ActionReport report, Subject subject)
Obtain a new command invocation object.CommandRunner.CommandInvocation
getCommandInvocation(String scope, String name, ActionReport report, Subject subject, boolean isNotify)
Obtain a new command invocation object.CommandRunner.CommandInvocation
getCommandInvocation(String name, ActionReport report, Subject subject)
Obtain a new command invocation object for the null scope.CommandRunner.CommandInvocation
getCommandInvocation(String name, ActionReport report, Subject subject, boolean isNotify)
Obtain a new command invocation object for the null scope.BufferedReader
getHelp(CommandModel model)
Returns manpage for the command.CommandModel
getModel(String scope, String name, Logger logger)
Returns the command model for a command nameCommandModel
getModel(String name, Logger logger)
Returns the command model for a command name for the null scopeboolean
validateCommandModelETag(AdminCommand command, String eTag)
Checks if given command model eTag is equal to current command model eTagboolean
validateCommandModelETag(CommandModel model, String eTag)
Checks if given command model eTag is equal to current command model eTag
-
-
-
Method Detail
-
getActionReport
ActionReport getActionReport(String name)
Returns an initialized ActionReport instance for the passed type or null if it cannot be found.- Parameters:
name
- actiopn report type name- Returns:
- uninitialized action report or null
-
getModel
CommandModel getModel(String name, Logger logger)
Returns the command model for a command name for the null scope- Parameters:
name
- command namelogger
- logger to log any error messages- Returns:
- model for this command (list of parameters,etc...), null if command is not found
-
getModel
CommandModel getModel(String scope, String name, Logger logger)
Returns the command model for a command name- Parameters:
scope
- the scope (or namespace) for the commandname
- command namelogger
- logger to log any error messages- Returns:
- model for this command (list of parameters,etc...), null if command is not found
-
getHelp
BufferedReader getHelp(CommandModel model)
Returns manpage for the command.- Parameters:
model
- of command- Returns:
- Formated manpage
-
validateCommandModelETag
boolean validateCommandModelETag(AdminCommand command, String eTag)
Checks if given command model eTag is equal to current command model eTag- Parameters:
command
- Command to be checkedeTag
- ETag to validate
-
validateCommandModelETag
boolean validateCommandModelETag(CommandModel model, String eTag)
Checks if given command model eTag is equal to current command model eTag- Parameters:
model
- of command to be checkedeTag
- ETag to validate
-
getCommand
AdminCommand getCommand(String commandName, ActionReport report, Logger logger)
Obtain and return the command implementation defined by the passed commandName for the null scope- Parameters:
commandName
- command name as typed by usersreport
- report used to communicate command status back to the userlogger
- logger to log- Returns:
- command registered under commandName or null if not found.
-
getCommand
AdminCommand getCommand(String scope, String commandName, ActionReport report, Logger logger)
Obtain and return the command implementation defined by the passed commandName- Parameters:
scope
- the scope (or namespace) for the commandcommandName
- command name as typed by usersreport
- report used to communicate command status back to the userlogger
- logger to log- Returns:
- command registered under commandName or null if not found.
-
getCommandInvocation
CommandRunner.CommandInvocation getCommandInvocation(String name, ActionReport report, Subject subject)
Obtain a new command invocation object for the null scope. Command invocations can be configured and used to trigger a command execution.- Parameters:
name
- name of the requested command to invokereport
- where to place the status of the command executionsubject
- the Subject under which to execute the command- Returns:
- a new command invocation for that command name.
-
getCommandInvocation
CommandRunner.CommandInvocation getCommandInvocation(String scope, String name, ActionReport report, Subject subject)
Obtain a new command invocation object. Command invocations can be configured and used to trigger a command execution.- Parameters:
scope
- the scope (or namespace) for the commandname
- name of the requested command to invokereport
- where to place the status of the command executionsubject
- the Subject under which to execute the command- Returns:
- a new command invocation for that command name.
-
getCommandInvocation
CommandRunner.CommandInvocation getCommandInvocation(String name, ActionReport report, Subject subject, boolean isNotify)
Obtain a new command invocation object for the null scope. Command invocations can be configured and used to trigger a command execution.- Parameters:
name
- name of the requested command to invokereport
- where to place the status of the command executionsubject
- the Subject under which to execute the commandisNotify
- should notification be enabled- Returns:
- a new command invocation for that command name.
-
getCommandInvocation
CommandRunner.CommandInvocation getCommandInvocation(String scope, String name, ActionReport report, Subject subject, boolean isNotify)
Obtain a new command invocation object. Command invocations can be configured and used to trigger a command execution.- Parameters:
scope
- the scope (or namespace) for the commandname
- name of the requested command to invokereport
- where to place the status of the command executionsubject
- the Subject under which to execute the commandisNotify
- should notification be enabled- Returns:
- a new command invocation for that command name.
-
-