
Package ca.uhn.fhir.jpa.sp
Class SearchParamIdentityCacheSvcImpl
java.lang.Object
ca.uhn.fhir.jpa.sp.SearchParamIdentityCacheSvcImpl
- All Implemented Interfaces:
ISearchParamIdentityCacheSvc
@Service
public class SearchParamIdentityCacheSvcImpl
extends Object
implements ISearchParamIdentityCacheSvc
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classThis class is responsible for ensuring that a uniqueIndexedSearchParamIdentityexists for a given hash identity (parameter name and resource type). -
Constructor Summary
ConstructorsConstructorDescriptionSearchParamIdentityCacheSvcImpl(JpaStorageSettings theStorageSettings, IResourceIndexedSearchParamIdentityDao theResourceIndexedSearchParamIdentityDao, org.springframework.transaction.PlatformTransactionManager theTxManager, MemoryCacheService theMemoryCacheService) -
Method Summary
Modifier and TypeMethodDescriptionvoidfindOrCreateSearchParamIdentity(Long theHashIdentity, String theResourceType, String theParamName) Asynchronously ensures that aIndexedSearchParamIdentityexists for the given hash identity, parameter name, and resource type.booleanprotected voidInitializes the cache by preloading search parameter identitiesIndexedSearchParamIdentity.voidvoidstart()
-
Constructor Details
-
SearchParamIdentityCacheSvcImpl
public SearchParamIdentityCacheSvcImpl(JpaStorageSettings theStorageSettings, IResourceIndexedSearchParamIdentityDao theResourceIndexedSearchParamIdentityDao, org.springframework.transaction.PlatformTransactionManager theTxManager, MemoryCacheService theMemoryCacheService)
-
-
Method Details
-
start
-
preDestroy
-
initCache
Initializes the cache by preloading search parameter identitiesIndexedSearchParamIdentity. -
hasInFlightTasks
- Specified by:
hasInFlightTasksin interfaceISearchParamIdentityCacheSvc
-
findOrCreateSearchParamIdentity
public void findOrCreateSearchParamIdentity(Long theHashIdentity, String theResourceType, String theParamName) Asynchronously ensures that aIndexedSearchParamIdentityexists for the given hash identity, parameter name, and resource type. If the identity is already present in the in-memory cache, no action is taken.If the identity is missing, a
SearchParamIdentityCacheSvcImpl.PersistSearchParameterIdentityTaskis created and submitted for asynchronous execution. To avoid modifying the cache during an active transaction, task submission is deferred until after the transaction is committed.- Specified by:
findOrCreateSearchParamIdentityin interfaceISearchParamIdentityCacheSvc- Parameters:
theHashIdentity- The hash identity representing the search parameter.theResourceType- The resource type (e.g., "Patient", "Observation").theParamName- The search parameter name.- See Also:
-