Class HashCache
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.core.ui.minimize.HashCache
- All Implemented Interfaces:
LogEnabled
,Initializable
,Component
,Serviceable
The cache for hashed list of files to minimize
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected AbstractCacheManager
CacheManager used to create and get cacheprotected RequestAttributesHelper
RequestAttributesHelperprotected ResourceDependenciesListExtensionPoint
ResourceDependenciesListExtensionPointstatic final String
The avalon ROLE -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreates and memorize a hash code corresponding to a list of filesgetFilesForHash
(String hash, boolean firstLevel) Get the file list corresponding to the given hashcodevoid
void
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The avalon ROLE -
_requestAttributesHelper
RequestAttributesHelper -
_resourceDependenciesListEP
ResourceDependenciesListExtensionPoint -
_cacheManager
CacheManager used to create and get cache
-
-
Constructor Details
-
HashCache
public HashCache()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
getFilesForHash
Get the file list corresponding to the given hashcode- Parameters:
hash
- The hashcode created by createHash in this sessionfirstLevel
- File imported by other files will not be included- Returns:
- The list of files or null if the hashcode does not exists
-
createHash
public String createHash(Map<String, Map<String, throws IllegalArgumentExceptionString>> files, String salt) Creates and memorize a hash code corresponding to a list of files- Parameters:
files
- The files. Key is the file uri and the value is a map with two keys 'media' and 'tag'.salt
- Additional parameter used as salt for the hash key.- Returns:
- The hash code
- Throws:
IllegalArgumentException
- If an error occurred
-