Class ManageCacheService
java.lang.Object
fr.paris.lutece.portal.service.cache.ManageCacheService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<K,V> CacheableService<K, V> Retrieves a cacheable service by its name from the registry.List<CacheableService<?,?>> Returns all registered Cacheable services<K,V> boolean isCacheExist(String cacheName) Checks if a cache with the specified name exists in the registry.<K,V> void registerCacheableService(CacheableService<K, V> cs) Registers a cacheable service in the registry.voidReset all caches
-
Constructor Details
-
ManageCacheService
public ManageCacheService()
-
-
Method Details
-
registerCacheableService
Registers a cacheable service in the registry.This method adds the provided cacheable service to the registry if a service with the same name is not already present. The cache status is determined and applied to the service based on its current configuration and status read from a file.
- Type Parameters:
K- the type of cache keysV- the type of cache values- Parameters:
cs- the cacheable service to register
-
isCacheExist
Checks if a cache with the specified name exists in the registry.This method checks whether a cacheable service with the given name is present in the registry. This helps determine if a cache can be accessed or managed.
- Parameters:
cacheName- the name of the cache- Returns:
trueif a cache with the specified name exists;falseotherwise
-
getCache
Retrieves a cacheable service by its name from the registry.This method returns the cacheable service associated with the specified name. The returned service is cast to the appropriate type based on the generic parameters.
- Type Parameters:
K- the type of cache keysV- the type of cache values- Parameters:
cacheName- the name of the cache- Returns:
- the cacheable service associated with the name, or
nullif no such service exists
-
getCacheableServicesList
Returns all registered Cacheable services- Returns:
- A collection containing all registered Cacheable services
-
resetCaches
public void resetCaches()Reset all caches
-