Interface FHIRPayloadPersistence

    • 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>
      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)
      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 resource
        resourceTypeId - the database id assigned to this resource type
        logicalId - the logical id of the resource
        version - the version of the resource
        resourcePayloadKey - the unique key used to tie this to the RDBMS record
        resource - 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 class
        rowResourceTypeName - the resource type name of the resource read from the database (matching the resourceTypeId)
        resourceTypeId - the unique int identifier for the resource type name
        logicalId - the logical identifier of the desired resource
        version - the specific version of the desired resource
        resourcePayloadKey - the resource payload key connecting the entry to the RDBMS record
        elements - 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 record
        elements -
        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 versions
        resourcePayloadKey - the key to make sure the entry matches the RDBMS record
        Throws:
        FHIRPersistenceException