Interface FHIRPayloadPersistence
-
- All Known Implementing Classes:
FHIRPayloadPersistenceBlobImpl
,FHIRPayloadPersistenceCassandraImpl
public interface FHIRPayloadPersistence
Used for storing and retrieving payload data. Implementations are expected to be locked to a particular tenant on instantiation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deletePayload(java.lang.String resourceType, int resourceTypeId, java.lang.String logicalId, java.lang.Integer version, java.lang.String resourcePayloadKey)
Delete the payload item.<T extends Resource>
TreadResource(java.lang.Class<T> resourceType, java.lang.String rowResourceTypeName, int resourceTypeId, java.lang.String logicalId, int version, java.lang.String resourcePayloadKey, java.util.List<java.lang.String> elements)
Retrieve the payload data for the given resourceTypeId, logicalId and version.<T extends Resource>
java.util.concurrent.CompletableFuture<ResourceResult<? extends Resource>>readResourceAsync(java.lang.Class<T> resourceType, java.lang.String rowResourceTypeName, int resourceTypeId, java.lang.String logicalId, int version, java.lang.String resourcePayloadKey, java.time.Instant lastUpdated, java.util.List<java.lang.String> elements)
Async retrieval of the payload data for the given resourceTypeId, logicalId and version.PayloadPersistenceResponse
storePayload(java.lang.String resourceTypeName, int resourceTypeId, java.lang.String logicalId, int version, java.lang.String resourcePayloadKey, Resource resource)
Store the payload.
-
-
-
Method Detail
-
storePayload
PayloadPersistenceResponse storePayload(java.lang.String resourceTypeName, int resourceTypeId, java.lang.String logicalId, int version, java.lang.String resourcePayloadKey, Resource resource) throws FHIRPersistenceException
Store the payload. The business key is the tuple {resourceTypeId, logicalId, version} This data is stored directly, and should ideally be compressed.- Parameters:
resourceTypeName
- the type name of the resourceresourceTypeId
- the database id assigned to this resource typelogicalId
- the logical id of the resourceversion
- the version of the resourceresourcePayloadKey
- the unique key used to tie this to the RDBMS recordresource
- the resource to store- Returns:
- the payload key details and future result status.
- Throws:
FHIRPersistenceException
-
readResource
<T extends Resource> T readResource(java.lang.Class<T> resourceType, java.lang.String rowResourceTypeName, int resourceTypeId, java.lang.String logicalId, int version, java.lang.String resourcePayloadKey, java.util.List<java.lang.String> elements) throws FHIRPersistenceException
Retrieve the payload data for the given resourceTypeId, logicalId and version. Synchronous.- Parameters:
resourceType
- the expected resource type classrowResourceTypeName
- the resource type name of the resource read from the database (matching the resourceTypeId)resourceTypeId
- the unique int identifier for the resource type namelogicalId
- the logical identifier of the desired resourceversion
- the specific version of the desired resourceresourcePayloadKey
- the resource payload key connecting the entry to the RDBMS recordelements
- to filter elements within the resource - can be null- Returns:
- the fhirResourcePayload exactly as it was provided to
#storePayload(String, int, String, int, String, byte[])
- Throws:
FHIRPersistenceException
-
readResourceAsync
<T extends Resource> java.util.concurrent.CompletableFuture<ResourceResult<? extends Resource>> readResourceAsync(java.lang.Class<T> resourceType, java.lang.String rowResourceTypeName, int resourceTypeId, java.lang.String logicalId, int version, java.lang.String resourcePayloadKey, java.time.Instant lastUpdated, java.util.List<java.lang.String> elements) throws FHIRPersistenceException
Async retrieval of the payload data for the given resourceTypeId, logicalId and version.- Type Parameters:
T
-- Parameters:
resourceType
-rowResourceTypeName
-resourceTypeId
-logicalId
-version
-resourcePayloadKey
-lastUpdated
- the last modification time of the resource in the RDBMS recordelements
-- Returns:
- Throws:
FHIRPersistenceException
-
deletePayload
void deletePayload(java.lang.String resourceType, int resourceTypeId, java.lang.String logicalId, java.lang.Integer version, java.lang.String resourcePayloadKey) throws FHIRPersistenceException
Delete the payload item. This may be called to clean up after a failed transaction or by the reconciliation process when it finds an orphaned record. when performing a hard delete on a resource.- Parameters:
resourceType
-resourceTypeId
-logicalId
-version
- the version id, or null for all versionsresourcePayloadKey
- the key to make sure the entry matches the RDBMS record- Throws:
FHIRPersistenceException
-
-