Class ResourceCacheService
- All Implemented Interfaces:
fr.paris.lutece.portal.service.cache.CacheableService<String,,Object> fr.paris.lutece.portal.service.cache.Lutece107Cache<String,,Object> fr.paris.lutece.portal.service.util.LuteceService,Closeable,Serializable,AutoCloseable,Iterable<javax.cache.Cache.Entry<String,,Object>> javax.cache.Cache<String,Object>
@ApplicationScoped
public class ResourceCacheService
extends fr.paris.lutece.portal.service.cache.AbstractCacheableService<String,Object>
Cache service for resources, resource types and resources providers
- See Also:
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription.static StringgetDatabaseResourceCacheKey(String strIdResource) Get the cache key for resources.getName()static StringgetResourceCacheKey(String strIdResource, String strResourceType) Get the cache key for resourcesstatic StringgetResourceTypeCacheKey(String strResourceType) Get the cache for resource typesstatic StringgetResourceTypeProviderCacheKey(String strResourceType) Get the cache key of the association between a resource provider and a resource typestatic StringGet the cache key for the list of resource typesvoidinit()void.boolean.Methods inherited from class fr.paris.lutece.portal.service.cache.AbstractCacheableService
clear, close, containsKey, deregisterCacheEntryListener, enableCache, getAll, getAndPut, getAndRemove, getAndReplace, getCache, getCacheManager, getCacheSize, getConfiguration, getFromCache, getInfos, getKeys, initCache, initCache, initCache, invoke, invokeAll, isCacheEnable, isClosed, isPreventGlobalReset, isPreventReset, isRequired, iterator, loadAll, putAll, putIfAbsent, putInCache, registerCacheEntryListener, remove, removeAll, removeAll, removeKey, replace, replace, resetCache, setCache, unwrapMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface fr.paris.lutece.portal.service.cache.CacheableService
getMaxElements, getMemorySize, getTimeToLiveMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ResourceCacheService
public ResourceCacheService()
-
-
Method Details
-
init
@PostConstruct public void init() -
put
. A provider failure is logged: the caller goes on without the cache -
get
. A provider failure is logged and read as a miss -
remove
. No test of the status: a cache disabled on this instance still forwards the removal to the cache shared with the other instances (the core keeps it open for that) -
getName
-
getResourceTypeProviderCacheKey
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
Get the cache key for the list of resource types- Returns:
- The cache key for the list of resource types
-
getResourceCacheKey
Get the cache key for resources- Parameters:
strIdResource- The id of the resourcestrResourceType- The resource type- Returns:
- The cache key for the given resource
-
getDatabaseResourceCacheKey
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 thegetResourceCacheKey(String strIdResource, String strResourceType)method.- Parameters:
strIdResource- The id of the resource- Returns:
- The cache key for the given resource
-
getResourceTypeCacheKey
Get the cache for resource types- Parameters:
strResourceType- The resource type- Returns:
- The cache key for the given resource type
-