@Override public Status getStatus() { return Status.SC_OK.fromCode(getTarget().getStatus().getCode()); }
/** * Adds the response headers for the handled uniform call. * * @param response * The response returned. */ protected void addResponseHeaders(HttpResponse response) { try { // Add all the necessary headers HeaderUtils.addGeneralHeaders(response, response.getHttpCall() .getResponseHeaders()); HeaderUtils.addResponseHeaders(response, response.getHttpCall() .getResponseHeaders()); // Set the status code in the response if (response.getStatus() != null) { response.getHttpCall().setStatusCode( response.getStatus().getCode()); response.getHttpCall().setReasonPhrase( response.getStatus().getReasonPhrase()); } } catch (Exception e) { getLogger().log(Level.WARNING, "Exception intercepted while adding the response headers", e); response.getHttpCall().setStatusCode( Status.SERVER_ERROR_INTERNAL.getCode()); response.getHttpCall().setReasonPhrase( Status.SERVER_ERROR_INTERNAL.getReasonPhrase()); } }
response.setEntity(null); } else if (Method.GET.equals(response.getRequest().getMethod()) && Status.SUCCESS_OK.equals(response.getStatus()) && (!response.isEntityAvailable())) { addEntityHeaders(response); .getResourceRef() + "\" returns one or sets the status to 204 (No content)."); } else if (response.getStatus().equals(Status.SUCCESS_NO_CONTENT)) { addEntityHeaders(response); response.setEntity(null); } else if (response.getStatus() .equals(Status.SUCCESS_RESET_CONTENT)) { if (response.isEntityAvailable()) { response.setEntity(null); } else if (response.getStatus().equals( Status.REDIRECTION_NOT_MODIFIED)) { if (response.getEntity() != null) { response.setEntity(null); } else if (response.getStatus().isInformational()) { if (response.isEntityAvailable()) { getLogger()