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 ofCachedResultinterface
- Direct Known Subclasses:
DownloadCache,ParsingCache,ValidationCache
The abstract class containing basic methods for handling the
Result implementations-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor instantiating cache with empty map -
Method Summary
Modifier and TypeMethodDescriptiondump()Produces a report of the current cache statevoidUpdates entry status to ERROR valuevoidUpdates the state for a CachedEntry matching to the given key to EXPIREDReturns the CachedEntry for the relatedcacheKey.protected abstract CacheTypeReturns a type of current CachegetKeys()Returns all current keysbooleanChecks if a CachedEntry for the given key is not up to datebooleanChecks if a CachedEntry for the given key is empty (has no result)booleanisRefreshNeeded(CacheKey cacheKey) Checks if a CachedEntry for the given key is not up to datebooleanisToBeDeleted(CacheKey cacheKey) Checks if the requested cacheKey has TO_BE_DELETED valuevoidRemoves the requested entry with the givencacheKeyvoidUpdates the state for a CachedEntry matching to the given key to SYNCHRONIZEDvoidtoBeDeleted(CacheKey cacheKey) Updates entry status to TO_BE_DELETED valuevoidUpdates in the cache the value forcacheKeywith 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 forcacheKeywith the givenresult- Parameters:
cacheKey-CacheKeykey to update value forresult-CachedResultto store
-
expire
-
remove
-
sync
-
isRefreshNeeded
-
isDesync
-
isEmpty
-
error
-
toBeDeleted
-
isToBeDeleted
-
getCacheType
-
dump
-