Class JDBCIdentityCacheImpl

  • All Implemented Interfaces:
    JDBCIdentityCache

    public class JDBCIdentityCacheImpl
    extends Object
    implements JDBCIdentityCache
    Pulls together the DAOs and tenant-specific cache to provide a single place where we can look up the identity of various records we need
    • Method Detail

      • getResourceTypeId

        public Integer getResourceTypeId​(String resourceType)
                                  throws com.ibm.fhir.persistence.exception.FHIRPersistenceException
        Description copied from interface: JDBCIdentityCache
        Get the database id for the named resourceType. Reads from a cache or database if required.
        Specified by:
        getResourceTypeId in interface JDBCIdentityCache
        Returns:
        Throws:
        com.ibm.fhir.persistence.exception.FHIRPersistenceException
      • getResourceTypeName

        public String getResourceTypeName​(Integer resourceTypeId)
                                   throws com.ibm.fhir.persistence.exception.FHIRPersistenceException
        Description copied from interface: JDBCIdentityCache
        Get the resource type name for the resourceTypeId. Reads from a cache or database if required.
        Specified by:
        getResourceTypeName in interface JDBCIdentityCache
        Returns:
        Throws:
        com.ibm.fhir.persistence.exception.FHIRPersistenceException
      • getCodeSystemId

        public Integer getCodeSystemId​(String codeSystemName)
                                throws com.ibm.fhir.persistence.exception.FHIRPersistenceException
        Description copied from interface: JDBCIdentityCache
        Get the database id for the named code-system. Creates new records if necessary
        Specified by:
        getCodeSystemId in interface JDBCIdentityCache
        Returns:
        Throws:
        com.ibm.fhir.persistence.exception.FHIRPersistenceException
      • getParameterNameId

        public Integer getParameterNameId​(String parameterName)
                                   throws com.ibm.fhir.persistence.exception.FHIRPersistenceException
        Description copied from interface: JDBCIdentityCache
        Get the database id for the given parameter name. Creates new records if necessary.
        Specified by:
        getParameterNameId in interface JDBCIdentityCache
        Returns:
        Throws:
        com.ibm.fhir.persistence.exception.FHIRPersistenceException
      • getCanonicalId

        public Integer getCanonicalId​(String canonicalValue)
                               throws com.ibm.fhir.persistence.exception.FHIRPersistenceException
        Description copied from interface: JDBCIdentityCache
        Get the database id for the given canonical value. Read only. If the value does not exist, -1 is returned.
        Specified by:
        getCanonicalId in interface JDBCIdentityCache
        Returns:
        Throws:
        com.ibm.fhir.persistence.exception.FHIRPersistenceException
      • getCommonTokenValueId

        public Long getCommonTokenValueId​(String codeSystem,
                                          String tokenValue)
        Description copied from interface: JDBCIdentityCache
        Get the common_token_value_id for the given tokenValue and codeSystem. Reads from a cache, or the database if not found in the cache.
        Specified by:
        getCommonTokenValueId in interface JDBCIdentityCache
        Returns:
        The common token value id or null if it doesn't exist
      • getCommonTokenValueIds

        public Set<Long> getCommonTokenValueIds​(Collection<CommonTokenValue> tokenValues)
        Description copied from interface: JDBCIdentityCache
        Get the common_token_value_ids for the given tokenValues. Reads from a cache, or the database if not found in the cache. CommonTokenValues with no corresponding record in the database will be omitted from the result set.
        Specified by:
        getCommonTokenValueIds in interface JDBCIdentityCache
        Returns:
        A non-null, possibly-empty set of common token value ids
      • getCommonTokenValueIdList

        public List<Long> getCommonTokenValueIdList​(String tokenValue)
        Description copied from interface: JDBCIdentityCache
        Get a list of matching common_token_value_id values. Implementations may decide to cache, but only if the cache can be invalidated when the list changes due to ingestion. The simplest approach is to always read from the database. The performance benefit to the FHIR search query this is being used for is orders of magnitude greater than the cost of this query (think 80+ seconds to 250 milliseconds improvement in search query time).
        Specified by:
        getCommonTokenValueIdList in interface JDBCIdentityCache
        Returns:
      • getResourceTypeNames

        public List<String> getResourceTypeNames()
                                          throws com.ibm.fhir.persistence.exception.FHIRPersistenceException
        Description copied from interface: JDBCIdentityCache
        Get the list of all resource type names.
        Specified by:
        getResourceTypeNames in interface JDBCIdentityCache
        Returns:
        Throws:
        com.ibm.fhir.persistence.exception.FHIRPersistenceException
      • getResourceTypeIds

        public List<Integer> getResourceTypeIds()
                                         throws com.ibm.fhir.persistence.exception.FHIRPersistenceException
        Description copied from interface: JDBCIdentityCache
        Get the list of all resource type ids.
        Specified by:
        getResourceTypeIds in interface JDBCIdentityCache
        Returns:
        Throws:
        com.ibm.fhir.persistence.exception.FHIRPersistenceException