public class HashCache extends AbstractLogEnabled implements Component, Serviceable
Modifier and Type | Class and Description |
---|---|
static class |
HashCache.UriData
The description of an URI
|
Modifier and Type | Field and Description |
---|---|
private Map<String,List<HashCache.UriData>> |
_hashCache
Hash cache
Key if file url
|
protected RequestAttributesHelper |
_requestAttributesHelper
RequestAttributesHelper
|
protected ResourceDependenciesListExtensionPoint |
_resourceDependenciesListEP
ResourceDependenciesListExtensionPoint
|
static String |
ROLE
The avalon ROLE
|
Constructor and Description |
---|
HashCache() |
Modifier and Type | Method and Description |
---|---|
String |
createHash(Map<String,Map<String,String>> files,
String salt)
Creates and memorize a hash code corresponding to a list of files
|
List<HashCache.UriData> |
getFilesForHash(String hash,
boolean firstLevel)
Get the file list corresponding to the given hashcode
|
void |
service(ServiceManager manager) |
getLogger, setLogger
protected RequestAttributesHelper _requestAttributesHelper
protected ResourceDependenciesListExtensionPoint _resourceDependenciesListEP
private Map<String,List<HashCache.UriData>> _hashCache
public HashCache()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public List<HashCache.UriData> getFilesForHash(String hash, boolean firstLevel)
hash
- The hashcode created by createHash in this sessionfirstLevel
- File imported by other files will not be includedpublic String createHash(Map<String,Map<String,String>> files, String salt) throws IllegalArgumentException
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.IllegalArgumentException
- If an error occurred