}
//Check command model
CommandModel model = getCommandModel(commandName);
checkCommandModelETag(model, modelETag);
//Execute it
ActionReporter ar = new PropsFileActionReporter(); //new RestActionReporter(); //Must use PropsFileActionReporter because some commands react diferently on it :-(
final RestPayloadImpl.Outbound outbound = new RestPayloadImpl.Outbound(false);
final CommandRunner.CommandInvocation commandInvocation =
getCommandRunner().getCommandInvocation(commandName.getScope(), commandName.getName(), ar, getSubject());
if (inbound != null) {
commandInvocation.inbound(inbound);
}
commandInvocation
.outbound(outbound)
.parameters(params)
.execute();
ar = (ActionReporter) commandInvocation.report();
fixActionReporterSpecialCases(ar);
ActionReport.ExitCode exitCode = ar.getActionExitCode();
int status = HttpURLConnection.HTTP_OK; /*200 - ok*/
if (exitCode == ActionReport.ExitCode.FAILURE) {
status = HttpURLConnection.HTTP_INTERNAL_ERROR;
}
ResponseBuilder rb = Response.status(status);