Class LpaCache
java.lang.Object
br.ufsc.labsec.utils.cache.Cache<Data>
br.ufsc.labsec.utils.cache.DetachedCache<Lpa,SignatureContainer<?>>
br.ufsc.labsec.signature.conformanceVerifier.signaturePolicy.lpa.LpaCache
- All Implemented Interfaces:
Iterable<CacheEntry<Lpa>>
public class LpaCache extends DetachedCache<Lpa,SignatureContainer<?>>
Esta classe é responsável por armazenar e recuperar LPAs da cache
-
Nested Class Summary
Nested classes/interfaces inherited from class br.ufsc.labsec.utils.cache.Cache
Cache.Source
-
Field Summary
Fields Modifier and Type Field Description static String
LPA_MATCHER
Fields inherited from class br.ufsc.labsec.utils.cache.Cache
path, regexFilter, runtimeCache
-
Constructor Summary
Constructors Constructor Description LpaCache(CacheComponent cacheComponent)
Construtor -
Method Summary
Modifier and Type Method Description protected Lpa
decodeEntry(byte[] encoded, byte[] sigEncoded)
Decodifica um objeto a partir de seus bytes e da assinatura destacadaOptional<Lpa>
get(String lpaUrl)
Obtém uma LPA a partir de sua URL, retirando o nome do arquivo que é a chave na cacheprotected String
groupFilesInDiskBy(File fileInDisk)
Função auxiliar para atribuir uma chave comum para arquivos, para serem juntados em umCacheEntry
só, podendo ser qualquer estrutura de string aceita peloCollectors.groupingBy(java.util.function.Function<? super T, ? extends K>)
Methods inherited from class br.ufsc.labsec.utils.cache.DetachedCache
decodeEntry, store, store
Methods inherited from class br.ufsc.labsec.utils.cache.Cache
checkExpired, getLastAccess, getSource, has, has, iterator, remove
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
LPA_MATCHER
-
-
Constructor Details
-
LpaCache
Construtor- Parameters:
cacheComponent
- Componente de caches
-
-
Method Details
-
get
Obtém uma LPA a partir de sua URL, retirando o nome do arquivo que é a chave na cache -
groupFilesInDiskBy
Description copied from class:Cache
Função auxiliar para atribuir uma chave comum para arquivos, para serem juntados em umCacheEntry
só, podendo ser qualquer estrutura de string aceita peloCollectors.groupingBy(java.util.function.Function<? super T, ? extends K>)
- Overrides:
groupFilesInDiskBy
in classCache<Lpa>
- Parameters:
fileInDisk
- O arquivo a ser agrupado- Returns:
- String com a chave comum
-
decodeEntry
Description copied from class:DetachedCache
Decodifica um objeto a partir de seus bytes e da assinatura destacada- Specified by:
decodeEntry
in classDetachedCache<Lpa,SignatureContainer<?>>
- Parameters:
encoded
- Os bytes do objetosigEncoded
- Os bytes da assinatura- Returns:
- O objeto decodificado
- Throws:
EncodingException
- Exceção em caso de erro na decodificação
-