@Service public class CommandRunnerImpl extends Object implements CommandRunner
CommandRunner.CommandInvocation
Constructor and Description |
---|
CommandRunnerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
executeFromCheckpoint(JobManager.Checkpoint checkpoint,
boolean revert,
AdminCommandEventBroker eventBroker) |
ActionReport |
getActionReport(String name)
Returns an initialized ActionReport instance for the passed type or
null if it cannot be found.
|
AdminCommand |
getCommand(String commandName,
ActionReport report,
Logger logger)
Obtain and return the command implementation defined by
the passed commandName for the null scope.
|
AdminCommand |
getCommand(String scope,
String commandName,
ActionReport report,
Logger logger)
Obtain and return the command implementation defined by
the passed commandName.
|
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.
|
CommandRunner.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.
|
void |
getHelp(AdminCommand command,
ActionReport report) |
BufferedReader |
getHelp(CommandModel model)
Returns manpage for the command.
|
static BufferedReader |
getManPage(String commandName,
CommandModel model)
Return an InputStream for the man page for the named command.
|
CommandModel |
getModel(String commandName,
Logger logger)
Returns the command model for a command name.
|
CommandModel |
getModel(String scope,
String commandName,
Logger logger)
Returns the command model for a command name.
|
static boolean |
injectParameters(CommandModel model,
Object injectionTarget,
InjectionResolver<Param> injector,
ActionReport report) |
boolean |
validateCommandModelETag(AdminCommand command,
String eTag)
Checks if given command model eTag is equal to current command model eTag
|
boolean |
validateCommandModelETag(CommandModel model,
String eTag)
Checks if given command model eTag is equal to current command model eTag
|
public ActionReport getActionReport(String name)
getActionReport
in interface CommandRunner
name
- action report type namepublic CommandModel getModel(String commandName, Logger logger)
getModel
in interface CommandRunner
commandName
- command namelogger
- logger to log any error messagespublic CommandModel getModel(String scope, String commandName, Logger logger)
getModel
in interface CommandRunner
commandName
- command namelogger
- logger to log any error messagesscope
- the scope (or namespace) for the commandpublic boolean validateCommandModelETag(AdminCommand command, String eTag)
CommandRunner
validateCommandModelETag
in interface CommandRunner
command
- Command to be checkedeTag
- ETag to validatepublic boolean validateCommandModelETag(CommandModel model, String eTag)
CommandRunner
validateCommandModelETag
in interface CommandRunner
model
- of command to be checkedeTag
- ETag to validatepublic AdminCommand getCommand(String commandName, ActionReport report, Logger logger)
getCommand
in interface CommandRunner
commandName
- command name as typed by usersreport
- report used to communicate command status back to the userlogger
- logger to logpublic AdminCommand getCommand(String scope, String commandName, ActionReport report, Logger logger)
getCommand
in interface CommandRunner
commandName
- command name as typed by usersreport
- report used to communicate command status back to the userlogger
- logger to logscope
- the scope (or namespace) for the commandpublic CommandRunner.CommandInvocation getCommandInvocation(String name, ActionReport report, Subject subject)
CommandRunner
getCommandInvocation
in interface CommandRunner
name
- name of the requested command to invokereport
- where to place the status of the command executionsubject
- the Subject under which to execute the commandpublic CommandRunner.CommandInvocation getCommandInvocation(String scope, String name, ActionReport report, Subject subject)
CommandRunner
getCommandInvocation
in interface CommandRunner
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 commandpublic CommandRunner.CommandInvocation getCommandInvocation(String name, ActionReport report, Subject subject, boolean isNotify)
getCommandInvocation
in interface CommandRunner
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 enabledpublic CommandRunner.CommandInvocation getCommandInvocation(String scope, String name, ActionReport report, Subject subject, boolean isNotify)
getCommandInvocation
in interface CommandRunner
scope
- the scope (or name space) 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 enabledpublic static boolean injectParameters(CommandModel model, Object injectionTarget, InjectionResolver<Param> injector, ActionReport report)
public BufferedReader getHelp(CommandModel model) throws com.sun.enterprise.v3.admin.CommandNotFoundException
CommandRunner
getHelp
in interface CommandRunner
model
- of commandcom.sun.enterprise.v3.admin.CommandNotFoundException
public void getHelp(AdminCommand command, ActionReport report)
public static BufferedReader getManPage(String commandName, CommandModel model)
public void executeFromCheckpoint(JobManager.Checkpoint checkpoint, boolean revert, AdminCommandEventBroker eventBroker)
Copyright © 2020. All rights reserved.