Class FHIRPersistenceJDBCCacheImpl
- java.lang.Object
-
- org.linuxforhealth.fhir.persistence.jdbc.cache.FHIRPersistenceJDBCCacheImpl
-
- All Implemented Interfaces:
FHIRPersistenceJDBCCache
public class FHIRPersistenceJDBCCacheImpl extends java.lang.Object implements FHIRPersistenceJDBCCache
Aggregates and manages the individual caches used for a tenant
-
-
Constructor Summary
Constructors Constructor Description FHIRPersistenceJDBCCacheImpl(INameIdCache<java.lang.Integer> resourceTypeCache, IIdNameCache<java.lang.Integer> resourceTypeNameCache, INameIdCache<java.lang.Integer> parameterNameCache, ICommonValuesCache commonValuesCache, ILogicalResourceIdentCache logicalResourceIdentCache)
Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearNeedToPrefill()
Clear the needToPrefill flag - call after the prefill has been doneICommonValuesCache
getCommonValuesCache()
Getter for the common values cacheILogicalResourceIdentCache
getLogicalResourceIdentCache()
Getter for the cache handling lookups for logical_resource_id valuesINameIdCache<java.lang.Integer>
getParameterNameCache()
Getter for the cache of parameter namesINameIdCache<java.lang.Integer>
getResourceTypeCache()
Getter for the cache of resource types used to look up resource type idIIdNameCache<java.lang.Integer>
getResourceTypeNameCache()
Getter for the cache of resource type ids used to look up resource type nameboolean
needToPrefill()
Returns true if the caller should attempt to prefill the caches.void
transactionCommitted()
Tell any caches that the transaction on the current thread has just committedvoid
transactionRolledBack()
The transaction on the current thread was rolled back, so throw away anything held in thread-local caches
-
-
-
Constructor Detail
-
FHIRPersistenceJDBCCacheImpl
public FHIRPersistenceJDBCCacheImpl(INameIdCache<java.lang.Integer> resourceTypeCache, IIdNameCache<java.lang.Integer> resourceTypeNameCache, INameIdCache<java.lang.Integer> parameterNameCache, ICommonValuesCache commonValuesCache, ILogicalResourceIdentCache logicalResourceIdentCache)
Public constructor- Parameters:
resourceTypeCache
-resourceTypeNameCache
-parameterNameCache
-commonValuesCache
-logicalResourceIdentCache
-
-
-
Method Detail
-
getCommonValuesCache
public ICommonValuesCache getCommonValuesCache()
Description copied from interface:FHIRPersistenceJDBCCache
Getter for the common values cache- Specified by:
getCommonValuesCache
in interfaceFHIRPersistenceJDBCCache
- Returns:
- the resourceReferenceCache
-
getResourceTypeCache
public INameIdCache<java.lang.Integer> getResourceTypeCache()
Description copied from interface:FHIRPersistenceJDBCCache
Getter for the cache of resource types used to look up resource type id- Specified by:
getResourceTypeCache
in interfaceFHIRPersistenceJDBCCache
- Returns:
- the resourceTypeCache
-
getResourceTypeNameCache
public IIdNameCache<java.lang.Integer> getResourceTypeNameCache()
Description copied from interface:FHIRPersistenceJDBCCache
Getter for the cache of resource type ids used to look up resource type name- Specified by:
getResourceTypeNameCache
in interfaceFHIRPersistenceJDBCCache
- Returns:
- the resourceTypeNameCache
-
getParameterNameCache
public INameIdCache<java.lang.Integer> getParameterNameCache()
Description copied from interface:FHIRPersistenceJDBCCache
Getter for the cache of parameter names- Specified by:
getParameterNameCache
in interfaceFHIRPersistenceJDBCCache
- Returns:
- the parameterNameCache
-
getLogicalResourceIdentCache
public ILogicalResourceIdentCache getLogicalResourceIdentCache()
Description copied from interface:FHIRPersistenceJDBCCache
Getter for the cache handling lookups for logical_resource_id values- Specified by:
getLogicalResourceIdentCache
in interfaceFHIRPersistenceJDBCCache
- Returns:
-
transactionCommitted
public void transactionCommitted()
Description copied from interface:FHIRPersistenceJDBCCache
Tell any caches that the transaction on the current thread has just committed- Specified by:
transactionCommitted
in interfaceFHIRPersistenceJDBCCache
-
transactionRolledBack
public void transactionRolledBack()
Description copied from interface:FHIRPersistenceJDBCCache
The transaction on the current thread was rolled back, so throw away anything held in thread-local caches- Specified by:
transactionRolledBack
in interfaceFHIRPersistenceJDBCCache
-
needToPrefill
public boolean needToPrefill()
Description copied from interface:FHIRPersistenceJDBCCache
Returns true if the caller should attempt to prefill the caches. Prefilling must only be done before any new records are inserted to ensure the shared caches contain only data which has been previously committed to the database.- Specified by:
needToPrefill
in interfaceFHIRPersistenceJDBCCache
- Returns:
-
clearNeedToPrefill
public void clearNeedToPrefill()
Description copied from interface:FHIRPersistenceJDBCCache
Clear the needToPrefill flag - call after the prefill has been done- Specified by:
clearNeedToPrefill
in interfaceFHIRPersistenceJDBCCache
-
-