Class CachedEntry<R extends CachedResult>
java.lang.Object
eu.europa.esig.dss.tsl.cache.state.CachedEntry<R>
- Type Parameters:
R- type of the entry
public class CachedEntry<R extends CachedResult> extends Object
Defines a cached entry
-
Constructor Summary
Constructors Constructor Description CachedEntry()Empty constructorCachedEntry(R cachedResult)Default constructor -
Method Summary
Modifier and Type Method Description voiderror(CachedException exception)Sets the errorvoidexpire()Expires the cache entryRgetCachedResult()Gets the cached resultCacheStateEnumgetCurrentState()Gets the state of the cacheDategetExceptionFirstOccurrenceTime()Gets the first time when the exception occurredDategetExceptionLastOccurrenceTime()Gets the last time when the exception occurredStringgetExceptionMessage()Gets the exception message for an error statusStringgetExceptionStackTrace()Gets the exception stack trace for an error statusDategetLastStateTransitionTime()Gets last status change timeDategetLastSuccessSynchronizationTime()Gets last synchronization timebooleanisDesync()Checks if the status 'desynchronized' is set for the cache entrybooleanisEmpty()Checks if the cache record is emptybooleanisError()Checks if the current status of the cache is errorbooleanisRefreshNeeded()Checks if the refresh is needed for the cache entrybooleanisToBeDeleted()Checks if the status 'toBeDeleted' is set for the cache entryvoidsync()Synchronizes the cache entryvoidsyncUpdateDate()Synchronizes the update datevoidtoBeDeleted()Sets 'toBeDeleted' status for the cache entryvoidupdate(R newCachedResult)Updates the cache record
-
Constructor Details
-
CachedEntry
public CachedEntry()Empty constructor -
CachedEntry
Default constructor- Parameters:
cachedResult- the cached result
-
-
Method Details
-
getCurrentState
Gets the state of the cache- Returns:
CacheStateEnum
-
getLastStateTransitionTime
Gets last status change time- Returns:
Date
-
getLastSuccessSynchronizationTime
Gets last synchronization time- Returns:
Date
-
getCachedResult
Gets the cached result- Returns:
- cached result
-
update
Updates the cache record- Parameters:
newCachedResult- new cache record
-
syncUpdateDate
public void syncUpdateDate()Synchronizes the update date -
error
Sets the error- Parameters:
exception-CachedException
-
expire
public void expire()Expires the cache entry -
sync
public void sync()Synchronizes the cache entry -
toBeDeleted
public void toBeDeleted()Sets 'toBeDeleted' status for the cache entry -
isToBeDeleted
public boolean isToBeDeleted()Checks if the status 'toBeDeleted' is set for the cache entry- Returns:
- TRUE if the status is 'toBeDeleted', FALSE otherwise
-
isDesync
public boolean isDesync()Checks if the status 'desynchronized' is set for the cache entry- Returns:
- TRUE if the status is 'desynchronized', FALSE otherwise
-
isRefreshNeeded
public boolean isRefreshNeeded()Checks if the refresh is needed for the cache entry- Returns:
- TRUE if refresh is needed', FALSE otherwise
-
isEmpty
public boolean isEmpty()Checks if the cache record is empty- Returns:
- TRUE if the cache record is empty, FALSE otherwise
-
isError
public boolean isError()Checks if the current status of the cache is error- Returns:
- TRUE if the status is error, FALSE otherwise
-
getExceptionMessage
Gets the exception message for an error status- Returns:
Stringexception message if error, FALSE otherwise
-
getExceptionStackTrace
Gets the exception stack trace for an error status- Returns:
Stringexception stack trace if error, FALSE otherwise
-
getExceptionFirstOccurrenceTime
Gets the first time when the exception occurred- Returns:
Datefirst time when the exception occurred if error, FALSE otherwise
-
getExceptionLastOccurrenceTime
Gets the last time when the exception occurred- Returns:
Datelast time when the exception occurred if error, FALSE otherwise
-