Class ServletSubRequestDetails

All Implemented Interfaces:
IHasServletAttributes

This class wraps a ServletRequestDetails object for processing sub-requests, such as processing individual entries in a transaction or batch bundle. An instance of this class is used for modifying some of the data in the request details, such as the request headers, for an individual entry, without affecting the original ServletRequestDetails.
  • Constructor Details

  • Method Details

    • getServletRequest

      public jakarta.servlet.http.HttpServletRequest getServletRequest()
      Overrides:
      getServletRequest in class ServletRequestDetails
    • getServletResponse

      public jakarta.servlet.http.HttpServletResponse getServletResponse()
      Overrides:
      getServletResponse in class ServletRequestDetails
    • addHeader

      public void addHeader(String theName, String theValue)
      Description copied from class: RequestDetails
      Adds a new header
      Overrides:
      addHeader in class ServletRequestDetails
      Parameters:
      theName - The header name
      theValue - The header value
    • getHeader

      public String getHeader(String theName)
      Overrides:
      getHeader in class ServletRequestDetails
    • getHeaders

      public List<String> getHeaders(String theName)
      Overrides:
      getHeaders in class ServletRequestDetails
    • setHeaders

      public void setHeaders(String theName, List<String> theValues)
      Description copied from class: RequestDetails
      Replaces any existing header(s) with the given name using a List of new header values
      Overrides:
      setHeaders in class ServletRequestDetails
      Parameters:
      theName - The header name
      theValues - The header value
    • getUserData

      @Nonnull public Map<Object,Object> getUserData()
      Description copied from class: RequestDetails
      Returns a map which can be used to hold any user specific data to pass it from one part of the request handling chain to another. Data in this map can use any key, although user code should try to use keys which are specific enough to avoid conflicts.

      A new map is created for each individual request that is handled by the server, so this map can be used (for example) to pass authorization details from an interceptor to the resource providers, or for example to pass data from a hook method on the Pointcut.SERVER_INCOMING_REQUEST_POST_PROCESSED to a later hook method on the Pointcut.SERVER_OUTGOING_RESPONSE pointcut.

      This method should be used to pass information between interceptor methods. For servlet-specific request attributes used to communicate between servlet filters, use IHasServletAttributes methods available on implementations that support them.

      Overrides:
      getUserData in class RequestDetails
    • isSubRequest

      public boolean isSubRequest()
      Description copied from class: RequestDetails
      Is this request a sub-request (i.e. a request within a batch or transaction)? This flag is used internally by hapi-fhir-jpaserver-base, but not used in the plain server library. You may use it in your client code as a hint when implementing transaction logic in the plain server.

      Defaults to false

      Overrides:
      isSubRequest in class RequestDetails