Class SearchParamRegistryImpl

java.lang.Object
ca.uhn.fhir.jpa.searchparam.registry.SearchParamRegistryImpl
All Implemented Interfaces:
IResourceChangeListener, ISearchParamHashIdentityRegistry, ISearchParamRegistryController, ca.uhn.fhir.rest.server.util.ISearchParamRegistry

public class SearchParamRegistryImpl extends Object implements ca.uhn.fhir.rest.server.util.ISearchParamRegistry, IResourceChangeListener, ISearchParamRegistryController, ISearchParamHashIdentityRegistry
  • Field Details

  • Constructor Details

  • Method Details

    • getActiveSearchParam

      public ca.uhn.fhir.context.RuntimeSearchParam getActiveSearchParam(@Nonnull String theResourceName, @Nonnull String theParamName, @Nonnull ca.uhn.fhir.rest.server.util.ISearchParamRegistry.SearchParamLookupContextEnum theContext)
      Specified by:
      getActiveSearchParam in interface ca.uhn.fhir.rest.server.util.ISearchParamRegistry
    • getActiveSearchParams

      @Nonnull public ca.uhn.fhir.rest.server.util.ResourceSearchParams getActiveSearchParams(@Nonnull String theResourceName, @Nonnull ca.uhn.fhir.rest.server.util.ISearchParamRegistry.SearchParamLookupContextEnum theContext)
      Specified by:
      getActiveSearchParams in interface ca.uhn.fhir.rest.server.util.ISearchParamRegistry
    • getActiveComboSearchParams

      public List<ca.uhn.fhir.context.RuntimeSearchParam> getActiveComboSearchParams(@Nonnull String theResourceName, @Nonnull ca.uhn.fhir.rest.server.util.ISearchParamRegistry.SearchParamLookupContextEnum theContext)
      Specified by:
      getActiveComboSearchParams in interface ca.uhn.fhir.rest.server.util.ISearchParamRegistry
    • getActiveComboSearchParams

      public List<ca.uhn.fhir.context.RuntimeSearchParam> getActiveComboSearchParams(@Nonnull String theResourceName, @Nonnull ca.uhn.fhir.context.ComboSearchParamType theParamType, @Nonnull ca.uhn.fhir.rest.server.util.ISearchParamRegistry.SearchParamLookupContextEnum theContext)
      Specified by:
      getActiveComboSearchParams in interface ca.uhn.fhir.rest.server.util.ISearchParamRegistry
    • getActiveComboSearchParams

      public List<ca.uhn.fhir.context.RuntimeSearchParam> getActiveComboSearchParams(@Nonnull String theResourceName, @Nonnull Set<String> theParamNames, @Nonnull ca.uhn.fhir.rest.server.util.ISearchParamRegistry.SearchParamLookupContextEnum theContext)
      Specified by:
      getActiveComboSearchParams in interface ca.uhn.fhir.rest.server.util.ISearchParamRegistry
    • getIndexedSearchParamByHashIdentity

      public Optional<ca.uhn.fhir.rest.server.util.IndexedSearchParam> getIndexedSearchParamByHashIdentity(Long theHashIdentity)
      Specified by:
      getIndexedSearchParamByHashIdentity in interface ISearchParamHashIdentityRegistry
    • getActiveSearchParamByUrl

      @Nullable public ca.uhn.fhir.context.RuntimeSearchParam getActiveSearchParamByUrl(@Nonnull String theUrl, @Nonnull ca.uhn.fhir.rest.server.util.ISearchParamRegistry.SearchParamLookupContextEnum theContext)
      Specified by:
      getActiveSearchParamByUrl in interface ca.uhn.fhir.rest.server.util.ISearchParamRegistry
    • getActiveComboSearchParamById

      public Optional<ca.uhn.fhir.context.RuntimeSearchParam> getActiveComboSearchParamById(@Nonnull String theResourceName, @Nonnull org.hl7.fhir.instance.model.api.IIdType theId)
      Specified by:
      getActiveComboSearchParamById in interface ca.uhn.fhir.rest.server.util.ISearchParamRegistry
    • setFhirContext

      public void setFhirContext(ca.uhn.fhir.context.FhirContext theFhirContext)
    • setStorageSettings

      public void setStorageSettings(StorageSettings theStorageSettings)
    • requestRefresh

      public void requestRefresh()
      Specified by:
      requestRefresh in interface ca.uhn.fhir.rest.server.util.ISearchParamRegistry
    • forceRefresh

      public void forceRefresh()
      Specified by:
      forceRefresh in interface ca.uhn.fhir.rest.server.util.ISearchParamRegistry
    • refreshCacheIfNecessary

      Specified by:
      refreshCacheIfNecessary in interface ISearchParamRegistryController
    • setResourceChangeListenerRegistry

      public void setResourceChangeListenerRegistry(IResourceChangeListenerRegistry theResourceChangeListenerRegistry)
    • registerListener

      @PostConstruct public void registerListener()
      There is a circular reference between this class and the ResourceChangeListenerRegistry: SearchParamRegistryImpl -> ResourceChangeListenerRegistry -> InMemoryResourceMatcher -> SearchParamRegistryImpl. Since we only need this once on boot-up, we delay until ContextRefreshedEvent.
    • unregisterListener

      @PreDestroy public void unregisterListener()
    • getActiveSearchParams

    • setActiveSearchParams

      public void setActiveSearchParams(RuntimeSearchParamCache theSearchParams)
    • setPhoneticEncoder

      public void setPhoneticEncoder(ca.uhn.fhir.context.phonetic.IPhoneticEncoder thePhoneticEncoder)
      All SearchParameters with the name "phonetic" encode the normalized index value using this phonetic encoder.
      Specified by:
      setPhoneticEncoder in interface ca.uhn.fhir.rest.server.util.ISearchParamRegistry
      Since:
      5.1.0
    • handleChange

      public void handleChange(IResourceChangeEvent theResourceChangeEvent)
      Description copied from interface: IResourceChangeListener
      Called by the IResourceChangeListenerRegistry when matching resource changes are detected
      Specified by:
      handleChange in interface IResourceChangeListener
    • handleInit

      public void handleInit(Collection<org.hl7.fhir.instance.model.api.IIdType> theResourceIds)
      Description copied from interface: IResourceChangeListener
      This method is called within ResourceChangeListenerCacheRefresherImpl.LOCAL_REFRESH_INTERVAL_MS of a listener registration
      Specified by:
      handleInit in interface IResourceChangeListener
      Parameters:
      theResourceIds - the ids of all resources that match the search parameters the listener was registered with
    • isInitialized

      public boolean isInitialized()
      Specified by:
      isInitialized in interface ca.uhn.fhir.rest.server.util.ISearchParamRegistry
    • resetForUnitTest

      public void resetForUnitTest()
    • setSearchParameterCanonicalizerForUnitTest

      public void setSearchParameterCanonicalizerForUnitTest(SearchParameterCanonicalizer theSearchParameterCanonicalizerForUnitTest)