Class FHIRRequestContext


  • public class FHIRRequestContext
    extends Object
    This class is used to hold FHIR REST API context information. There are non-static methods for maintaining individual instances, as well as static methods for setting instances on and getting instances from thread local. The overall strategy is for the REST API servlet filter to retrieve the request context information, create an instance of this class and set it on the current thread for use by the FHIR Server as it processes the request.
    • Method Detail

      • getTenantId

        public String getTenantId()
      • isReadOnly

        public boolean isReadOnly()
        Returns true iff the entire request can be processed using only reads in the persistence layer Permits persistence layer implementations to leverage read-only replicas if they are available
        Returns:
      • setReadOnly

        public void setReadOnly​(boolean flag)
        Setter for the readOnly flag
        Parameters:
        flag -
      • isBulk

        public boolean isBulk()
        the status of the FHIR request
        Returns:
        the status of the FHIRRequest indicating bulk
      • setBulk

        public void setBulk​(boolean bulk)
        set the bulk status
        Parameters:
        bulk -
      • getDataStoreId

        public String getDataStoreId()
      • setExtendedOperationProperties

        public void setExtendedOperationProperties​(String name,
                                                   Object value)
        set an Operation Context property
        Parameters:
        name -
        value -
      • getExtendedOperationProperties

        public Object getExtendedOperationProperties​(String name)
        get an extended Operation Context property
        Parameters:
        name -
        Returns:
      • set

        public static void set​(FHIRRequestContext context)
        Sets the specified FHIRRequestContext instance on the current thread, so that it can be used by FHIR Server downstream processing. This method is called when the FHIR Server starts processing a request.
      • get

        public static FHIRRequestContext get()
        Returns the FHIRRequestContext on the current thread.
      • remove

        public static void remove()
        Removes the FHIRRequestContext that's set on the current thread. This method is called when the FHIR Server is finished processing a request.
      • getRequestUniqueId

        public String getRequestUniqueId()
      • getHandlingPreference

        public HTTPHandlingPreference getHandlingPreference()
        Returns:
        the handlingPreference
      • setHandlingPreference

        public void setHandlingPreference​(HTTPHandlingPreference handlingPreference)
        Parameters:
        handlingPreference - the handlingPreference to set
      • getReturnPreference

        public HTTPReturnPreference getReturnPreference()
        Returns:
        the returnPreference
      • setReturnPreference

        public void setReturnPreference​(HTTPReturnPreference returnPreference)
        Parameters:
        returnPreference - the returnPreference to set
      • getOriginalRequestUri

        public String getOriginalRequestUri()
        Returns:
        the originalRequestUri
      • setOriginalRequestUri

        public void setOriginalRequestUri​(String originalRequestUri)
        Parameters:
        originalRequestUri - the originalRequestUri to set
      • getHttpHeaders

        public Map<String,​List<String>> getHttpHeaders()
        Returns:
        the httpHeaders
      • setHttpHeaders

        public void setHttpHeaders​(Map<String,​List<String>> httpHeaders)
        Parameters:
        httpHeaders - the httpHeaders to set