Package ca.uhn.fhir.jpa.cache
Interface IResourceChangeListenerCache
- All Known Implementing Classes:
ResourceChangeListenerCache
public interface IResourceChangeListenerCache
This is a handle to the cache created by
IResourceChangeListenerRegistry
when a listener is registered.
This this handle can be used to refresh the cache if required.-
Method Summary
Modifier and TypeMethodDescriptionRefresh the cache immediately in the current thread and notify its listener if there are any changesboolean
If nextRefreshTime is in the past, then update the cache with the current repository contents and notify its listener of any changesvoid
sets the nextRefreshTime toinvalid reference
Instant.MIN
invalid reference
ResourceChangeListenerCacheRefresherImpl.LOCAL_REFRESH_INTERVAL_MS
-
Method Details
-
getSearchParameterMap
- Returns:
- the search parameter map the listener was registered with
-
isInitialized
boolean isInitialized()- Returns:
- whether the cache has been initialized. (If not, the cache will be empty.)
-
getResourceName
- Returns:
- the name of the resource type the listener was registered with
-
getNextRefreshTime
- Returns:
- the next scheduled time the cache will search the repository, update its cache and notify its listener of any changes
-
requestRefresh
void requestRefresh()sets the nextRefreshTime toinvalid reference
Instant.MIN
invalid reference
ResourceChangeListenerCacheRefresherImpl.LOCAL_REFRESH_INTERVAL_MS
-
forceRefresh
Refresh the cache immediately in the current thread and notify its listener if there are any changes- Returns:
- counts of detected resource creates, updates and deletes
-
refreshCacheIfNecessary
If nextRefreshTime is in the past, then update the cache with the current repository contents and notify its listener of any changes- Returns:
- counts of detected resource creates, updates and deletes
-