Class CacheAccessByKey
java.lang.Object
eu.europa.esig.dss.tsl.cache.access.ReadOnlyCacheAccessByKey
eu.europa.esig.dss.tsl.cache.access.CacheAccessByKey
public class CacheAccessByKey extends ReadOnlyCacheAccessByKey
Accesses a cache records by the specified key
-
Field Summary
Fields inherited from class eu.europa.esig.dss.tsl.cache.access.ReadOnlyCacheAccessByKey
downloadCache, key, parsingCache, validationCache -
Constructor Summary
Constructors Constructor Description CacheAccessByKey(CacheKey key, DownloadCache downloadCache, ParsingCache parsingCache, ValidationCache validationCache)Default constructor -
Method Summary
Modifier and Type Method Description voiddeleteDownloadCacheIfNeeded()Removes the entry from downloadCache if its value is TO_BE_DELETEDvoiddeleteParsingCacheIfNeeded()Removes the entry from parsingCache if its value is TO_BE_DELETEDvoiddeleteValidationCacheIfNeeded()Removes the entry from parsingCache if its value is TO_BE_DELETEDvoiddownloadError(Exception e)Sets the download errorvoidexpireParsing()Sets the parsing record to the expired statevoidexpireValidation()Expires the validation recordCacheKeygetCacheKey()Returns the CacheKeybooleanisFileNeedToBeDeleted()Checks if the entry must be deleted from the file cache (download cache)booleanisParsingRefreshNeeded()Gets of the parsing refresh is neededbooleanisUpToDate(XmlDownloadResult xmlDownloadResult)Checks if the download result is up to date for the given keybooleanisValidationRefreshNeeded()Gets if the validation refresh is neededvoidparsingError(Exception e)Sets the parsing errorvoidupdate(XmlDownloadResult result)Updates the download resultvoidupdate(AbstractParsingResult parsingResult)Updates the parsing resultvoidupdate(ValidationResult validationResult)Updates the validation recordvoidvalidationError(Exception e)Sets the validation errorMethods inherited from class eu.europa.esig.dss.tsl.cache.access.ReadOnlyCacheAccessByKey
getDownloadReadOnlyResult, getParsingReadOnlyResult, getValidationReadOnlyResult
-
Constructor Details
-
CacheAccessByKey
public CacheAccessByKey(CacheKey key, DownloadCache downloadCache, ParsingCache parsingCache, ValidationCache validationCache)Default constructor- Parameters:
key-CacheKeyto usedownloadCache-DownloadCacheparsingCache-ParsingCachevalidationCache-ValidationCache
-
-
Method Details
-
getCacheKey
Returns the CacheKey- Returns:
CacheKey
-
isUpToDate
Checks if the download result is up to date for the given key- Parameters:
xmlDownloadResult-XmlDownloadResult- Returns:
- TRUE if the download result matches, FALSE otherwise
-
update
Updates the download result- Parameters:
result-XmlDownloadResultto store
-
downloadError
Sets the download error- Parameters:
e-Exception
-
isParsingRefreshNeeded
public boolean isParsingRefreshNeeded()Gets of the parsing refresh is needed- Returns:
- TRUE if the parsing refresh is needed, FALSE otherwise
-
update
Updates the parsing result- Parameters:
parsingResult-AbstractParsingResultto store
-
expireParsing
public void expireParsing()Sets the parsing record to the expired state -
parsingError
Sets the parsing error- Parameters:
e-Exception
-
isValidationRefreshNeeded
public boolean isValidationRefreshNeeded()Gets if the validation refresh is needed- Returns:
- TRUE if the validation refresh is needed, FALSE otherwise
-
expireValidation
public void expireValidation()Expires the validation record -
update
Updates the validation record- Parameters:
validationResult-ValidationResultto store
-
validationError
Sets the validation error- Parameters:
e-Exception
-
isFileNeedToBeDeleted
public boolean isFileNeedToBeDeleted()Checks if the entry must be deleted from the file cache (download cache)- Returns:
- TRUE if the entry need to be deleted, FALSE otherwise
-
deleteDownloadCacheIfNeeded
public void deleteDownloadCacheIfNeeded()Removes the entry from downloadCache if its value is TO_BE_DELETED -
deleteParsingCacheIfNeeded
public void deleteParsingCacheIfNeeded()Removes the entry from parsingCache if its value is TO_BE_DELETED -
deleteValidationCacheIfNeeded
public void deleteValidationCacheIfNeeded()Removes the entry from parsingCache if its value is TO_BE_DELETED
-