Class FHIRPersistenceContextImpl
- java.lang.Object
-
- org.linuxforhealth.fhir.persistence.context.impl.FHIRPersistenceContextImpl
-
- All Implemented Interfaces:
FHIRPersistenceContext
public class FHIRPersistenceContextImpl extends java.lang.Object implements FHIRPersistenceContext
This class provides a concrete implementation of the FHIRPersistenceContext interface and is used to pass request context-related information to the persistence layer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FHIRPersistenceContextImpl.Builder
Builder to create new instances of FHIRPersistenceContextImpl
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FHIRPersistenceContextImpl.Builder
builder(FHIRPersistenceEvent event)
Factory function to create a FHIRPersistenceContext builderFHIRHistoryContext
getHistoryContext()
Returns the FHIRHistoryContext instance associated with the current request.java.lang.Integer
getIfNoneMatch()
Get the encoded ifNoneMatch value which is interpreted as follows:PayloadPersistenceResponse
getOffloadResponse()
Get the payload persistence responseFHIRPersistenceEvent
getPersistenceEvent()
Returns the FHIRPersistenceEvent instance for the current request.java.lang.String
getRequestShard()
Get the key used for sharding used by the distributed schema variant.FHIRSearchContext
getSearchContext()
Returns the FHIRSearchContext instance associated with the current request.void
setIfNoneMatch(java.lang.Integer ifNoneMatch)
Setter for the If-None-Match header valuevoid
setOffloadResponse(PayloadPersistenceResponse offloadResponse)
void
setRequestShard(java.lang.String value)
Set the shardKey value
-
-
-
Method Detail
-
builder
public static FHIRPersistenceContextImpl.Builder builder(FHIRPersistenceEvent event)
Factory function to create a FHIRPersistenceContext builder- Parameters:
event
-- Returns:
-
getPersistenceEvent
public FHIRPersistenceEvent getPersistenceEvent()
Description copied from interface:FHIRPersistenceContext
Returns the FHIRPersistenceEvent instance for the current request. This contains information about the security context, HTTP headers, request URI information, etc.- Specified by:
getPersistenceEvent
in interfaceFHIRPersistenceContext
-
getHistoryContext
public FHIRHistoryContext getHistoryContext()
Description copied from interface:FHIRPersistenceContext
Returns the FHIRHistoryContext instance associated with the current request. This will be null if the current request is not a 'history' operation.- Specified by:
getHistoryContext
in interfaceFHIRPersistenceContext
-
getSearchContext
public FHIRSearchContext getSearchContext()
Description copied from interface:FHIRPersistenceContext
Returns the FHIRSearchContext instance associated with the current request. This will be null if the current request is not a 'search' operation.- Specified by:
getSearchContext
in interfaceFHIRPersistenceContext
-
getRequestShard
public java.lang.String getRequestShard()
Description copied from interface:FHIRPersistenceContext
Get the key used for sharding used by the distributed schema variant. If the tenant is not configured for distribution, the value will be null- Specified by:
getRequestShard
in interfaceFHIRPersistenceContext
- Returns:
- the shard key value specified in the request
-
setRequestShard
public void setRequestShard(java.lang.String value)
Set the shardKey value- Parameters:
value
-
-
setIfNoneMatch
public void setIfNoneMatch(java.lang.Integer ifNoneMatch)
Setter for the If-None-Match header value- Parameters:
ifNoneMatch
-
-
getIfNoneMatch
public java.lang.Integer getIfNoneMatch()
Description copied from interface:FHIRPersistenceContext
Get the encoded ifNoneMatch value which is interpreted as follows:null: create-on-update proceeds as normal 0: create-on-update returns 304 if resource exists, 201 if created
- Specified by:
getIfNoneMatch
in interfaceFHIRPersistenceContext
- Returns:
- the value from the If-None-Match header in the PUT request
-
getOffloadResponse
public PayloadPersistenceResponse getOffloadResponse()
Description copied from interface:FHIRPersistenceContext
Get the payload persistence response- Specified by:
getOffloadResponse
in interfaceFHIRPersistenceContext
- Returns:
-
setOffloadResponse
public void setOffloadResponse(PayloadPersistenceResponse offloadResponse)
- Parameters:
offloadResponse
- the offloadResponse to set
-
-