Interface FHIRPayloadPersistence


  • public interface FHIRPayloadPersistence
    Used for storing and retrieving payload data. Implementations are expected to be locked to a particular tenant on instantiation.
    • Method Detail

      • storePayload

        Future<PayloadKey> storePayload​(String resourceTypeName,
                                        int resourceTypeId,
                                        String logicalId,
                                        int version,
                                        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 resource
        resourceTypeId - the database id assigned to this resource type
        logicalId - the logical id of the resource
        version - the version of the resource
        resource - the resource to store
        Returns:
        a Future holding the payload key and status.
        Throws:
        FHIRPersistenceException
      • readResource

        <T extends Resource> T readResource​(Class<T> resourceType,
                                            int resourceTypeId,
                                            String logicalId,
                                            int version,
                                            List<String> elements)
                                     throws FHIRPersistenceException
        Retrieve the payload data for the given resourceTypeId, logicalId and version. Synchronous.
        Parameters:
        resourceType - the expected resource type class
        resourceTypeId - the unique int idenfifier for the resource type
        logicalId - the logical identifier of the desired resource
        version - the specific version of the desired resource
        elements - to filter elements within the resource - can be null
        Returns:
        the fhirResourcePayload exactly as it was provided to #storePayload(String, int, String, int, byte[])
        Throws:
        FHIRPersistenceException
      • deletePayload

        void deletePayload​(int resourceTypeId,
                           String logicalId,
                           int version)
                    throws FHIRPersistenceException
        Delete the payload item. This may be called to clean up after a failed transaction
        Parameters:
        resourceTypeId -
        logicalId -
        version -
        Throws:
        FHIRPersistenceException