
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 class
static class
This class is responsible for ensuring that a uniqueIndexedSearchParamIdentity
exists 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 TypeMethodDescriptionvoid
findOrCreateSearchParamIdentity
(Long theHashIdentity, String theResourceType, String theParamName) Asynchronously ensures that aIndexedSearchParamIdentity
exists for the given hash identity, parameter name, and resource type.protected void
Initializes the cache by preloading search parameter identitiesIndexedSearchParamIdentity
.void
void
start()
-
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
. -
findOrCreateSearchParamIdentity
public void findOrCreateSearchParamIdentity(Long theHashIdentity, String theResourceType, String theParamName) Asynchronously ensures that aIndexedSearchParamIdentity
exists 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.PersistSearchParameterIdentityTask
is 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:
findOrCreateSearchParamIdentity
in 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:
-