Interface CacheProvider


  • public interface CacheProvider
    This is a provider (pluggable functionality) for DSpace.

    This allows an external system to define how caches are handled in DSpace by implementing this interface and registering it with the service manager.

    Author:
    Aaron Zeckoski (azeckoski @ gmail.com)
    • Method Detail

      • getCaches

        List<Cache> getCaches()
        Gets all the caches that this provider knows about.
        Returns:
        a list of all the caches which the caching service knows about
      • getCache

        Cache getCache​(String cacheName,
                       CacheConfig config)
        Construct a Cache with the given name (must be unique) OR retrieve the one that already exists with this name.

        NOTE: providers will never be asked to provide request caches (e.g. CacheConfig.CacheScope.REQUEST)

        Parameters:
        cacheName - the unique name for this cache (e.g. org.dspace.user.UserCache)
        config - (optional) a configuration object. The cache should adhere to the settings in it. If it is null then just use defaults.
        Returns:
        a cache which can be used to store serializable objects
        Throws:
        IllegalArgumentException - if the cache name is already in use or the config is invalid
      • destroyCache

        void destroyCache​(String cacheName)
        Flush and destroy the cache with this name. If the cache does not exist then this does nothing (should not fail if the cache does not exist).
        Parameters:
        cacheName - the unique name for this cache (e.g. org.dspace.user.UserCache)
      • resetCaches

        void resetCaches()
        Clears the contents of all caches managed by this provider