protected Response executeCommandLegacyFormat(ParameterMap data) {
RestActionReporter actionReport = ResourceUtil.runCommand(commandName, data, getSubject());
final ActionReport.ExitCode exitCode = actionReport.getActionExitCode();
final int status = (exitCode == ActionReport.ExitCode.FAILURE) ?
HttpURLConnection.HTTP_INTERNAL_ERROR : HttpURLConnection.HTTP_OK;
ActionReportResult option = (ActionReportResult) optionsLegacyFormat();
ActionReportResult results = new ActionReportResult(commandName, actionReport, option.getMetaData());
results.getActionReport().getExtraProperties().putAll(option.getActionReport().getExtraProperties());
results.setCommandDisplayName(commandDisplayName);
if (exitCode == ActionReport.ExitCode.FAILURE) {
results.setErrorMessage(actionReport.getCombinedMessage());
}
return Response.status(status).entity(results).build();
}