Class CacheConfigUtil
java.lang.Object
fr.paris.lutece.portal.service.cache.CacheConfigUtil
Utility class for configuring and managing cache settings.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<fr.paris.lutece.portal.service.cache.CacheConfigUtil.CacheConfig>buildCacheConfigs(Map<String, String> properties) Builds a list of cache configurations from the given properties map.static URIcreateTempEhcacheConfigFile(List<fr.paris.lutece.portal.service.cache.CacheConfigUtil.CacheConfig> cacheConfigs, fr.paris.lutece.portal.service.cache.CacheConfigUtil.CacheConfig defaultCacheConfig) Creates a temporary Ehcache configuration file.determineCaheName(Set<String> keys) Determines the unique cache name prefixes from a set of property keys.static URIGenerates or updates the Ehcache configuration.static List<fr.paris.lutece.portal.service.cache.CacheConfigUtil.CacheConfig>Retrieves cache configurations.Builds the cache configuration map.static StringReturn the key of a datastore propertystatic <K,V> String getInfos(javax.cache.configuration.Configuration<K, V> conf) Returns cache configstatic booleangetStatusFromDataBase(String cacheName) Returns the cache status froms databasestatic URIpreConfigureCacheManager(String uriValue, javax.cache.spi.CachingProvider cachingProvider, Properties properties) Pre-configures a cache manager with the given URI, caching provider, and properties.
-
Field Details
-
CACHE_LOGGER_NAME
- See Also:
-
-
Constructor Details
-
CacheConfigUtil
public CacheConfigUtil()
-
-
Method Details
-
preConfigureCacheManager
public static URI preConfigureCacheManager(String uriValue, javax.cache.spi.CachingProvider cachingProvider, Properties properties) throws IOException Pre-configures a cache manager with the given URI, caching provider, and properties.- Parameters:
uriValue- The URI value for the cache configuration.cachingProvider- The caching provider.properties- The properties to configure the cache.- Returns:
- The configured URI.
- Throws:
IOException- If an I/O error occurs.
-
generateOrUpdateEhCacheConfig
Generates or updates the Ehcache configuration.- Returns:
- The URI of the generated or updated Ehcache configuration.
- Throws:
IOException- If an I/O error occurs.
-
createTempEhcacheConfigFile
public static URI createTempEhcacheConfigFile(List<fr.paris.lutece.portal.service.cache.CacheConfigUtil.CacheConfig> cacheConfigs, fr.paris.lutece.portal.service.cache.CacheConfigUtil.CacheConfig defaultCacheConfig) throws IOException Creates a temporary Ehcache configuration file.- Parameters:
cacheConfigs- The list of cache configurations.defaultCacheConfig- The default cache configuration.- Returns:
- The URI of the created configuration file.
- Throws:
IOException- If an I/O error occurs.
-
getCahesConfigs
public static List<fr.paris.lutece.portal.service.cache.CacheConfigUtil.CacheConfig> getCahesConfigs()Retrieves cache configurations.- Returns:
- A list of cache configurations.
-
getConfigPropertiesWithPrefix
Builds the cache configuration map.- Returns:
- A map of cache configurations.
-
buildCacheConfigs
public static List<fr.paris.lutece.portal.service.cache.CacheConfigUtil.CacheConfig> buildCacheConfigs(Map<String, String> properties) Builds a list of cache configurations from the given properties map.- Parameters:
properties- A map of properties where keys represent cache configuration parameters.- Returns:
- A list of
CacheConfigUtil.CacheConfigobjects configured according to the given properties.
-
determineCaheName
Determines the unique cache name prefixes from a set of property keys.- Parameters:
keys- A set of property keys.- Returns:
- A set of unique cache name prefixes extracted from the keys.
-
getStatusFromDataBase
Returns the cache status froms database- Parameters:
cs- The cacheable service- Returns:
- The status
-
getDSKey
Return the key of a datastore property- Parameters:
strCacheName- The cacheable servicestrProperty- The property- Returns:
- The DS key
-
getInfos
Returns cache config- Parameters:
cache- The cache- Returns:
- Cache infos
-