Class DefaultAsCacheStrategy

java.lang.Object
de.hybris.platform.adaptivesearch.strategies.impl.DefaultAsCacheStrategy
All Implemented Interfaces:
AsCacheStrategy, org.springframework.beans.factory.InitializingBean

public class DefaultAsCacheStrategy extends Object implements AsCacheStrategy, org.springframework.beans.factory.InitializingBean
Default implementation of AsCacheStrategy that uses the region cache from the platform.
  • Field Details

  • Constructor Details

    • DefaultAsCacheStrategy

      public DefaultAsCacheStrategy()
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • loadCacheSettings

      protected void loadCacheSettings()
    • isEnabled

      public boolean isEnabled(AsCacheScope cacheScope)
      Description copied from interface: AsCacheStrategy
      Checks if the cache is enabled for the given AsCacheScope.
      Specified by:
      isEnabled in interface AsCacheStrategy
      Returns:
      true if the cache is enabled, false otherwise
    • getWithLoader

      public <V> V getWithLoader(AsCacheKey cacheKey, Function<AsCacheKey,V> valueLoader)
      Description copied from interface: AsCacheStrategy
      Returns the value in the cache for the given key. If the key is null or the value is not yet in the cache, valueLoader will be used to load the missing value.
      Specified by:
      getWithLoader in interface AsCacheStrategy
      Parameters:
      cacheKey - - the cache key
      valueLoader - - function to load values
      Returns:
      the cached value
    • clear

      public void clear()
      Description copied from interface: AsCacheStrategy
      Clears the cache by removing all cached entries.
      Specified by:
      clear in interface AsCacheStrategy
    • getSize

      public long getSize()
      Description copied from interface: AsCacheStrategy
      Returns number of elements currently in the cache.
      Specified by:
      getSize in interface AsCacheStrategy
    • getHits

      public long getHits()
      Description copied from interface: AsCacheStrategy
      Returns the hit count.
      Specified by:
      getHits in interface AsCacheStrategy
    • getMisses

      public long getMisses()
      Description copied from interface: AsCacheStrategy
      Returns the miss count.
      Specified by:
      getMisses in interface AsCacheStrategy
    • getTenantId

      protected String getTenantId()
    • getTenantService

      public TenantService getTenantService()
    • setTenantService

      public void setTenantService(TenantService tenantService)
    • getConfigurationService

      public ConfigurationService getConfigurationService()
    • setConfigurationService

      public void setConfigurationService(ConfigurationService configurationService)
    • getCacheRegion

      public CacheRegion getCacheRegion()
    • setCacheRegion

      public void setCacheRegion(CacheRegion cacheRegion)