use of fish.payara.asadmin.recorder.AsadminRecorderService in project Payara by payara.
the class ResourceUtil method runCommand.
/**
* Executes the specified __asadmin command.
* @param commandName
* @param parameters
* @param subject
* @param managedJob
* @return
*/
public static RestActionReporter runCommand(String commandName, ParameterMap parameters, Subject subject, boolean managedJob) {
AsadminRecorderService asadminRecorderService = Globals.getDefaultHabitat().getService(AsadminRecorderService.class);
if (asadminRecorderService.isEnabled()) {
asadminRecorderService.recordAsadminCommand(commandName, parameters);
}
CommandRunner cr = Globals.getDefaultHabitat().getService(CommandRunner.class);
RestActionReporter ar = new RestActionReporter();
final CommandInvocation commandInvocation = cr.getCommandInvocation(commandName, ar, subject);
if (managedJob) {
commandInvocation.managedJob();
}
commandInvocation.parameters(parameters).execute();
addCommandLog(ar, commandName, parameters);
return ar;
}
Aggregations