try {
event = new RestEvent(restMethod.getName(), restRequest, projectId, applicationId, resourceId, restMethod.getId());
if (RestMethodStatus.DISABLED.equals(restMethod.getStatus())) {
throw new RestException("The requested REST method, " + restMethod.getName() + ", is disabled");
} else if (RestMethodStatus.FORWARDED.equals(restMethod.getStatus())) {
response = forwardRequest(restRequest, projectId, applicationId, resourceId, restMethod, pathParameters);
} else if (RestMethodStatus.RECORDING.equals(restMethod.getStatus())) {
response = forwardRequestAndRecordResponse(restRequest, projectId, applicationId, resourceId, restMethod, pathParameters);
} else if (RestMethodStatus.RECORD_ONCE.equals(restMethod.getStatus())) {
response = forwardRequestAndRecordResponseOnce(restRequest, projectId, applicationId, resourceId, restMethod, pathParameters);
} else if (RestMethodStatus.ECHO.equals(restMethod.getStatus())) {
response = echoResponse(restRequest);
} else {