Class ResourceCacheService

  • All Implemented Interfaces:
    fr.paris.lutece.portal.service.cache.CacheableService, fr.paris.lutece.portal.service.util.LuteceService, java.lang.Cloneable, net.sf.ehcache.event.CacheEventListener

    public final class ResourceCacheService
    extends fr.paris.lutece.portal.service.cache.AbstractCacheableService
    Cache service for resources, resource types and resources providers
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getDatabaseResourceCacheKey​(java.lang.String strIdResource)
      Get the cache key for resources.
      static ResourceCacheService getInstance()
      Get the instance of the service
      java.lang.String getName()
      static java.lang.String getResourceCacheKey​(java.lang.String strIdResource, java.lang.String strResourceType)
      Get the cache key for resources
      static java.lang.String getResourceTypeCacheKey​(java.lang.String strResourceType)
      Get the cache for resource types
      static java.lang.String getResourceTypeProviderCacheKey​(java.lang.String strResourceType)
      Get the cache key of the association between a resource provider and a resource type
      static java.lang.String getResourceTypesListCacheKey()
      Get the cache key for the list of resource types
      • Methods inherited from class fr.paris.lutece.portal.service.cache.AbstractCacheableService

        clone, dispose, enableCache, getCache, getCacheSize, getFromCache, getInfos, getKeys, getMaxElements, getMemorySize, getStatistics, getTimeToLive, initCache, initCache, isCacheEnable, notifyElementEvicted, notifyElementExpired, notifyElementPut, notifyElementRemoved, notifyElementUpdated, notifyRemoveAll, putInCache, removeKey, resetCache
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInstance

        public static ResourceCacheService getInstance()
        Get the instance of the service
        Returns:
        The instance of the service
      • getName

        public java.lang.String getName()
      • getResourceTypeProviderCacheKey

        public static java.lang.String getResourceTypeProviderCacheKey​(java.lang.String strResourceType)
        Get the cache key of the association between a resource provider and a resource type
        Parameters:
        strResourceType - The resource type
        Returns:
        The cache key of the association between a resource provider and a resource type
      • getResourceTypesListCacheKey

        public static java.lang.String getResourceTypesListCacheKey()
        Get the cache key for the list of resource types
        Returns:
        The cache key for the list of resource types
      • getResourceCacheKey

        public static java.lang.String getResourceCacheKey​(java.lang.String strIdResource,
                                                           java.lang.String strResourceType)
        Get the cache key for resources
        Parameters:
        strIdResource - The id of the resource
        strResourceType - The resource type
        Returns:
        The cache key for the given resource
      • getDatabaseResourceCacheKey

        public static java.lang.String getDatabaseResourceCacheKey​(java.lang.String strIdResource)
        Get the cache key for resources. This method should only be used to manage database resource type keys.
        To cache resources of any other providers, use the getResourceCacheKey(String strIdResource, String strResourceType) method.
        Parameters:
        strIdResource - The id of the resource
        Returns:
        The cache key for the given resource
      • getResourceTypeCacheKey

        public static java.lang.String getResourceTypeCacheKey​(java.lang.String strResourceType)
        Get the cache for resource types
        Parameters:
        strResourceType - The resource type
        Returns:
        The cache key for the given resource type