Create utility method for accessing the reqyest detail

This commit is contained in:
James Agnew 2019-09-09 15:02:12 -04:00
parent 718fcb28a5
commit 7e41951508
1 changed files with 5 additions and 1 deletions

View File

@ -848,7 +848,7 @@ public class RestfulServer extends HttpServlet implements IRestfulServer<Servlet
@SuppressWarnings("WeakerAccess")
protected void handleRequest(RequestTypeEnum theRequestType, HttpServletRequest theRequest, HttpServletResponse theResponse) throws ServletException, IOException {
String fhirServerBase;
ServletRequestDetails requestDetails = new ServletRequestDetails(getInterceptorService());
ServletRequestDetails requestDetails = newRequestDetails();
requestDetails.setServer(this);
requestDetails.setRequestType(theRequestType);
requestDetails.setServletRequest(theRequest);
@ -1095,6 +1095,10 @@ public class RestfulServer extends HttpServlet implements IRestfulServer<Servlet
}
}
protected ServletRequestDetails newRequestDetails() {
return new ServletRequestDetails(getInterceptorService());
}
protected void addRequestIdToResponse(ServletRequestDetails theRequestDetails, String theRequestId) {
theRequestDetails.getResponse().addHeader(Constants.HEADER_REQUEST_ID, theRequestId);
}