Package org.glassfish.api.admin
Interface CommandRunner<T extends Job>
CommandRunner is a service that allows you to run administrative commands.
- Author:
- Jerome Dochez
-
Method Summary
Modifier and TypeMethodDescriptionvoiddoCommand(CommandInvocation<T> ctx, AdminCommand command, Subject subject, T job) getActionReport(String name) Returns an initialized ActionReport instance for the passed type or null if it cannot be found.getCommand(String scope, String commandName, ActionReport report) Obtain and return the command implementation defined by the passed commandNamegetCommand(String commandName, ActionReport report) Obtain and return the command implementation defined by the passed commandName for the null scopegetCommandInvocation(String scope, String commandName, ActionReport report, Subject subject, boolean notify, boolean detach) Obtain a new command invocation object.default CommandInvocation<T> getCommandInvocation(String commandName, ActionReport report, Subject subject) Obtain a new command invocation object.getHelp(CommandModel model) Returns manpage for the command.Returns the command model for a command name for the null scopeReturns the command model for a command namebooleanvalidateCommandModelETag(AdminCommand command, String eTag) Checks if given command model eTag is equal to current command model eTagbooleanvalidateCommandModelETag(CommandModel model, String eTag) Checks if given command model eTag is equal to current command model eTag
-
Method Details
-
getActionReport
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
Returns the command model for a command name for the null scope- Parameters:
name- command name- Returns:
- model for this command (list of parameters,etc...), null if command is not found
-
getModel
Returns the command model for a command name- Parameters:
scope- the scope (or namespace) for the commandname- command name- Returns:
- model for this command (list of parameters,etc...), null if command is not found
-
getHelp
Returns manpage for the command.- Parameters:
model- of command- Returns:
- Formated manpage
-
validateCommandModelETag
Checks if given command model eTag is equal to current command model eTag- Parameters:
command- Command to be checkedeTag- ETag to validate
-
validateCommandModelETag
Checks if given command model eTag is equal to current command model eTag- Parameters:
model- of command to be checkedeTag- ETag to validate
-
getCommand
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 user- Returns:
- command registered under commandName or null if not found.
-
getCommand
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 user- Returns:
- command registered under commandName or null if not found.
-
getCommandInvocation
default CommandInvocation<T> getCommandInvocation(String commandName, ActionReport report, Subject subject) Obtain a new command invocation object. CallsgetCommandInvocation(String, String, ActionReport, Subject, boolean, boolean)with null scope, false notify and false detach.- Parameters:
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
CommandInvocation<T> getCommandInvocation(String scope, String commandName, ActionReport report, Subject subject, boolean notify, boolean detach) Obtain a new command invocation object.- Parameters:
scope- the scope (or namespace) for the commandcommandName- name of the requested command to invokereport- where to place the status of the command executionsubject- the Subject under which to execute the commandnotify- should notification be enableddetach- true if the command was executed as detached- Returns:
- a new command invocation for that command name.
-
doCommand
-