Package eu.europa.esig.dss.tsl.cache
Class AbstractCache<R extends CachedResult>
java.lang.Object
eu.europa.esig.dss.tsl.cache.AbstractCache<R>
- Type Parameters:
R
- implementation ofCachedResult
interface
- Direct Known Subclasses:
DownloadCache
,ParsingCache
,ValidationCache
The abstract class containing basic methods for handling the
Result
implementations-
Constructor Summary
ModifierConstructorDescriptionprotected
Default constructor instantiating cache with empty map -
Method Summary
Modifier and TypeMethodDescriptiondump()
Produces a report of the current cache statevoid
Updates entry status to ERROR valuevoid
Updates the state for a CachedEntry matching to the given key to EXPIREDReturns the CachedEntry for the relatedcacheKey
.protected abstract CacheType
Returns a type of current CachegetKeys()
Returns all current keysboolean
Checks if a CachedEntry for the given key is not up to dateboolean
Checks if a CachedEntry for the given key is empty (has no result)boolean
isRefreshNeeded
(CacheKey cacheKey) Checks if a CachedEntry for the given key is not up to dateboolean
isToBeDeleted
(CacheKey cacheKey) Checks if the requested cacheKey has TO_BE_DELETED valuevoid
Removes the requested entry with the givencacheKey
void
Updates the state for a CachedEntry matching to the given key to SYNCHRONIZEDvoid
toBeDeleted
(CacheKey cacheKey) Updates entry status to TO_BE_DELETED valuevoid
Updates in the cache the value forcacheKey
with the givenresult
-
Constructor Details
-
AbstractCache
protected AbstractCache()Default constructor instantiating cache with empty map
-
-
Method Details
-
getKeys
-
get
Returns the CachedEntry for the relatedcacheKey
. Returns new empty entry if no result found for the key- Parameters:
cacheKey
-CacheKey
- Returns:
CachedEntry
-
update
Updates in the cache the value forcacheKey
with the givenresult
- Parameters:
cacheKey
-CacheKey
key to update value forresult
-CachedResult
to store
-
expire
-
remove
-
sync
-
isRefreshNeeded
-
isDesync
-
isEmpty
-
error
-
toBeDeleted
-
isToBeDeleted
-
getCacheType
-
dump
-