Class CurrentCacheContext
java.lang.Object
eu.europa.esig.dss.tsl.cache.state.CurrentCacheContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddesync()Set the context as DESYNCHRONIZEDvoiderror(CachedExceptionWrapper cachedException) Store the exception for its occurrence timevoiderrorUpdateDate(CachedExceptionWrapper updatedException) Store the last occurrence of this exceptionReturns the current state in the cacheReturns the met exceptionReturns the date of the last state transitionReturns the last time when the cache has been synchronized successfully NOTE: can be null in case if the cache has never been synchronizedbooleanisDesync()Returns TRUE if the cache is in DESYNC statusbooleanisError()Returns TRUE if the cache is in a error statusbooleanReturns TRUE is a refresh is needed (missing / expired data)booleanReturns TRUE if the cache is in TO_BE_DELETED statusvoidSet the context as REFRESH_NEEDEDvoidstate(CacheState newState) This method operates a state changevoidsync()Set the context as SYNCHRONIZEDvoidUpdates the lastSuccessSynchronization datevoidSet the context as TO_BE_DELETED
-
Constructor Details
-
CurrentCacheContext
public CurrentCacheContext()Default constructor
-
-
Method Details
-
getCurrentState
Description copied from interface:CacheContextReturns the current state in the cache- Specified by:
getCurrentStatein interfaceCacheContext- Returns:
- the Cache state
-
getLastStateTransitionTime
Description copied from interface:CacheContextReturns the date of the last state transition- Specified by:
getLastStateTransitionTimein interfaceCacheContext- Returns:
- the last date when the state has had a transition
-
getLastSuccessSynchronizationTime
Description copied from interface:CacheContextReturns the last time when the cache has been synchronized successfully NOTE: can be null in case if the cache has never been synchronized- Specified by:
getLastSuccessSynchronizationTimein interfaceCacheContext- Returns:
- the last date when the state has been synchronized
-
state
Description copied from interface:CacheContextThis method operates a state change- Specified by:
statein interfaceCacheContext- Parameters:
newState- the new state to be assigned
-
syncUpdateDate
public void syncUpdateDate()Description copied from interface:CacheContextUpdates the lastSuccessSynchronization date- Specified by:
syncUpdateDatein interfaceCacheContext
-
error
Description copied from interface:CacheContextStore the exception for its occurrence time- Specified by:
errorin interfaceCacheContext- Parameters:
cachedException- an instance ofCachedExceptionWrapper
-
errorUpdateDate
Description copied from interface:CacheContextStore the last occurrence of this exception- Specified by:
errorUpdateDatein interfaceCacheContext- Parameters:
updatedException- an instance ofCachedExceptionWrapper
-
desync
public void desync()Description copied from interface:CacheContextSet the context as DESYNCHRONIZED- Specified by:
desyncin interfaceCacheContext
-
sync
public void sync()Description copied from interface:CacheContextSet the context as SYNCHRONIZED- Specified by:
syncin interfaceCacheContext
-
refreshNeeded
public void refreshNeeded()Description copied from interface:CacheContextSet the context as REFRESH_NEEDED- Specified by:
refreshNeededin interfaceCacheContext
-
toBeDeleted
public void toBeDeleted()Description copied from interface:CacheContextSet the context as TO_BE_DELETED- Specified by:
toBeDeletedin interfaceCacheContext
-
isRefreshNeeded
public boolean isRefreshNeeded()Description copied from interface:CacheContextReturns TRUE is a refresh is needed (missing / expired data)- Specified by:
isRefreshNeededin interfaceCacheContext- Returns:
- TRUE if a refresh is required
-
isError
public boolean isError()Description copied from interface:CacheContextReturns TRUE if the cache is in a error status- Specified by:
isErrorin interfaceCacheContext- Returns:
- TRUE if an exception is stored
-
getException
Description copied from interface:CacheContextReturns the met exception- Specified by:
getExceptionin interfaceCacheContext- Returns:
- an object with the exception and its occurrence time
-
isToBeDeleted
public boolean isToBeDeleted()Description copied from interface:CacheContextReturns TRUE if the cache is in TO_BE_DELETED status- Specified by:
isToBeDeletedin interfaceCacheContext- Returns:
- TRUE if the entry must be deleted
-
isDesync
public boolean isDesync()Description copied from interface:CacheContextReturns TRUE if the cache is in DESYNC status- Specified by:
isDesyncin interfaceCacheContext- Returns:
- TRUE if the entry is desynchronized
-