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;