Class JDBCIdentityCacheImpl
- java.lang.Object
-
- com.ibm.fhir.persistence.jdbc.dao.impl.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
-
-
Constructor Summary
Constructors Constructor Description JDBCIdentityCacheImpl(FHIRPersistenceJDBCCache cache, ResourceDAO resourceDAO, ParameterDAO parameterDAO, IResourceReferenceDAO rrd)Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegergetCanonicalId(String canonicalValue)Get the database id for the given canonical value.IntegergetCodeSystemId(String codeSystemName)Get the database id for the named code-system.LonggetCommonTokenValueId(String codeSystem, String tokenValue)Get the common_token_value_id for the given tokenValue and codeSystem.List<Long>getCommonTokenValueIdList(String tokenValue)Get a list of matching common_token_value_id values.IntegergetParameterNameId(String parameterName)Get the database id for the given parameter name.IntegergetResourceTypeId(String resourceType)Get the database id for the named resourceType.List<Integer>getResourceTypeIds()Get the list of all resource type ids.StringgetResourceTypeName(Integer resourceTypeId)Get the resource type name for the resourceTypeId.List<String>getResourceTypeNames()Get the list of all resource type names.
-
-
-
Constructor Detail
-
JDBCIdentityCacheImpl
public JDBCIdentityCacheImpl(FHIRPersistenceJDBCCache cache, ResourceDAO resourceDAO, ParameterDAO parameterDAO, IResourceReferenceDAO rrd)
Public constructor- Parameters:
cache-parameterDAO-rrd-
-
-
Method Detail
-
getResourceTypeId
public Integer getResourceTypeId(String resourceType) throws FHIRPersistenceException
Description copied from interface:JDBCIdentityCacheGet the database id for the named resourceType. Reads from a cache or database if required.- Specified by:
getResourceTypeIdin interfaceJDBCIdentityCache- Returns:
- Throws:
FHIRPersistenceException
-
getResourceTypeName
public String getResourceTypeName(Integer resourceTypeId) throws FHIRPersistenceException
Description copied from interface:JDBCIdentityCacheGet the resource type name for the resourceTypeId. Reads from a cache or database if required.- Specified by:
getResourceTypeNamein interfaceJDBCIdentityCache- Returns:
- Throws:
FHIRPersistenceException
-
getCodeSystemId
public Integer getCodeSystemId(String codeSystemName) throws FHIRPersistenceException
Description copied from interface:JDBCIdentityCacheGet the database id for the named code-system. Creates new records if necessary- Specified by:
getCodeSystemIdin interfaceJDBCIdentityCache- Returns:
- Throws:
FHIRPersistenceException
-
getParameterNameId
public Integer getParameterNameId(String parameterName) throws FHIRPersistenceException
Description copied from interface:JDBCIdentityCacheGet the database id for the given parameter name. Creates new records if necessary.- Specified by:
getParameterNameIdin interfaceJDBCIdentityCache- Returns:
- Throws:
FHIRPersistenceException
-
getCanonicalId
public Integer getCanonicalId(String canonicalValue) throws FHIRPersistenceException
Description copied from interface:JDBCIdentityCacheGet the database id for the given canonical value. Read only. If the value does not exist, -1 is returned.- Specified by:
getCanonicalIdin interfaceJDBCIdentityCache- Returns:
- Throws:
FHIRPersistenceException
-
getCommonTokenValueId
public Long getCommonTokenValueId(String codeSystem, String tokenValue)
Description copied from interface:JDBCIdentityCacheGet 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:
getCommonTokenValueIdin interfaceJDBCIdentityCache
-
getCommonTokenValueIdList
public List<Long> getCommonTokenValueIdList(String tokenValue)
Description copied from interface:JDBCIdentityCacheGet 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:
getCommonTokenValueIdListin interfaceJDBCIdentityCache- Returns:
-
getResourceTypeNames
public List<String> getResourceTypeNames() throws FHIRPersistenceException
Description copied from interface:JDBCIdentityCacheGet the list of all resource type names.- Specified by:
getResourceTypeNamesin interfaceJDBCIdentityCache- Returns:
- Throws:
FHIRPersistenceException
-
getResourceTypeIds
public List<Integer> getResourceTypeIds() throws FHIRPersistenceException
Description copied from interface:JDBCIdentityCacheGet the list of all resource type ids.- Specified by:
getResourceTypeIdsin interfaceJDBCIdentityCache- Returns:
- Throws:
FHIRPersistenceException
-
-