Interface CacheableService<K,V>

Type Parameters:
K - the type of keys maintained by the cache
V - the type of cached values
All Superinterfaces:
LuteceService
All Known Subinterfaces:
Lutece107Cache<K,V>
All Known Implementing Classes:
AbstractCacheableService, BaseUserPreferencesCacheService, Default107Cache, LinksIncludeCacheService, LuteceUserCacheService, PageCacheService, PathCacheService, PortletCacheService, ResourceService

public interface CacheableService<K,V> extends LuteceService
Base interface of Lutece services that provide a cache. Uses the JCache API to make cache statistics available via the CacheStatisticsMXBean.
  • Method Details

    • isCacheEnable

      boolean isCacheEnable()
      Gets the current cache status.
      Returns:
      true if the cache is enabled, otherwise false
    • getCacheSize

      int getCacheSize()
      Gets the number of items currently in the cache.
      Returns:
      the number of items currently in the cache
    • resetCache

      void resetCache()
      Resets the cache.
    • enableCache

      void enableCache(boolean bEnable)
      Enables or disables the cache.
      Parameters:
      bEnable - true to enable, false to disable
    • getKeys

      List<K> getKeys()
      Gets all keys in the cache.
      Returns:
      a list of all keys in the cache
    • getMaxElements

      @Deprecated default int getMaxElements()
      Deprecated.
      Returns the maximum number of elements accepted into the cache. This method will be removed in the next version: Use the JCache API to make cache statistics available via the CacheStatisticsMXBean.
      Returns:
      the maximum number of elements
    • getTimeToLive

      @Deprecated default long getTimeToLive()
      Deprecated.
      Returns the time to live for objects in the cache. This method will be removed in the next version: Use the JCache API to make cache statistics available via the CacheStatisticsMXBean.
      Returns:
      the time to live in seconds
    • getMemorySize

      @Deprecated default long getMemorySize()
      Deprecated.
      Returns the memory size of the cache. This method will be removed in the next version: Use the JCache API to make cache statistics available via the CacheStatisticsMXBean.
      Returns:
      the memory size
    • getInfos

      String getInfos()
      Returns cache information.
      Returns:
      cache information
    • isPreventGlobalReset

      boolean isPreventGlobalReset()
      Can the cache be reset by automatic caches resets
      Returns:
      true is the cache can be reset by automatic / massive caches resets, false otherwise