* @return
*/
public ActionReporter executeCommand(Subject subject, String command, ParameterMap parameters, boolean throwBadRequest, boolean throwOnWarning) {
RestActionReporter ar = ResourceUtil.runCommand(command, parameters,
Globals.getDefaultHabitat(), "", subject); //TODO The last parameter is resultType and is not used. Refactor the called method to remove it
ExitCode code = ar.getActionExitCode();
if (code.equals(ExitCode.FAILURE) || (code.equals(ExitCode.WARNING) && throwOnWarning)) {
if (throwBadRequest) {
throw new WebApplicationException(Response.status(Status.BAD_REQUEST)
.entity(ar.getCombinedMessage())
.build());
} else {