Package com.ibm.fhir.config
Class FHIRRequestContext
- java.lang.Object
-
- com.ibm.fhir.config.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.
-
-
Constructor Summary
Constructors Constructor Description FHIRRequestContext()
FHIRRequestContext(String tenantId)
FHIRRequestContext(String tenantId, String dataStoreId)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FHIRRequestContext
get()
Returns the FHIRRequestContext on the current thread.String
getDataStoreId()
HTTPHandlingPreference
getHandlingPreference()
Map<String,List<String>>
getHttpHeaders()
String
getOriginalRequestUri()
String
getRequestUniqueId()
HTTPReturnPreference
getReturnPreference()
String
getTenantId()
static void
remove()
Removes the FHIRRequestContext that's set on the current thread.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.void
setDataStoreId(String dataStoreId)
void
setHandlingPreference(HTTPHandlingPreference handlingPreference)
void
setHttpHeaders(Map<String,List<String>> httpHeaders)
void
setOriginalRequestUri(String originalRequestUri)
void
setReturnPreference(HTTPReturnPreference returnPreference)
void
setTenantId(String tenantId)
String
toString()
-
-
-
Constructor Detail
-
FHIRRequestContext
public FHIRRequestContext()
-
FHIRRequestContext
public FHIRRequestContext(String tenantId) throws FHIRException
- Throws:
FHIRException
-
FHIRRequestContext
public FHIRRequestContext(String tenantId, String dataStoreId) throws FHIRException
- Throws:
FHIRException
-
-
Method Detail
-
getTenantId
public String getTenantId()
-
setTenantId
public void setTenantId(String tenantId) throws FHIRException
- Throws:
FHIRException
-
getDataStoreId
public String getDataStoreId()
-
setDataStoreId
public void setDataStoreId(String dataStoreId) throws FHIRException
- Throws:
FHIRException
-
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
-
-