Class CurrentCacheContext
java.lang.Object
eu.europa.esig.dss.tsl.cache.state.CurrentCacheContext
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
desync()
Set the context as DESYNCHRONIZEDvoid
error
(CachedExceptionWrapper cachedException) Store the exception for its occurrence timevoid
errorUpdateDate
(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 synchronizedboolean
isDesync()
Returns TRUE if the cache is in DESYNC statusboolean
isError()
Returns TRUE if the cache is in a error statusboolean
Returns TRUE is a refresh is needed (missing / expired data)boolean
Returns TRUE if the cache is in TO_BE_DELETED statusvoid
Set the context as REFRESH_NEEDEDvoid
state
(CacheState newState) This method operates a state changevoid
sync()
Set the context as SYNCHRONIZEDvoid
Updates the lastSuccessSynchronization datevoid
Set the context as TO_BE_DELETED
-
Constructor Details
-
CurrentCacheContext
public CurrentCacheContext()Default constructor
-
-
Method Details
-
getCurrentState
Description copied from interface:CacheContext
Returns the current state in the cache- Specified by:
getCurrentState
in interfaceCacheContext
- Returns:
- the Cache state
-
getLastStateTransitionTime
Description copied from interface:CacheContext
Returns the date of the last state transition- Specified by:
getLastStateTransitionTime
in interfaceCacheContext
- Returns:
- the last date when the state has had a transition
-
getLastSuccessSynchronizationTime
Description copied from interface:CacheContext
Returns 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:
getLastSuccessSynchronizationTime
in interfaceCacheContext
- Returns:
- the last date when the state has been synchronized
-
state
Description copied from interface:CacheContext
This method operates a state change- Specified by:
state
in interfaceCacheContext
- Parameters:
newState
- the new state to be assigned
-
syncUpdateDate
public void syncUpdateDate()Description copied from interface:CacheContext
Updates the lastSuccessSynchronization date- Specified by:
syncUpdateDate
in interfaceCacheContext
-
error
Description copied from interface:CacheContext
Store the exception for its occurrence time- Specified by:
error
in interfaceCacheContext
- Parameters:
cachedException
- an instance ofCachedExceptionWrapper
-
errorUpdateDate
Description copied from interface:CacheContext
Store the last occurrence of this exception- Specified by:
errorUpdateDate
in interfaceCacheContext
- Parameters:
updatedException
- an instance ofCachedExceptionWrapper
-
desync
public void desync()Description copied from interface:CacheContext
Set the context as DESYNCHRONIZED- Specified by:
desync
in interfaceCacheContext
-
sync
public void sync()Description copied from interface:CacheContext
Set the context as SYNCHRONIZED- Specified by:
sync
in interfaceCacheContext
-
refreshNeeded
public void refreshNeeded()Description copied from interface:CacheContext
Set the context as REFRESH_NEEDED- Specified by:
refreshNeeded
in interfaceCacheContext
-
toBeDeleted
public void toBeDeleted()Description copied from interface:CacheContext
Set the context as TO_BE_DELETED- Specified by:
toBeDeleted
in interfaceCacheContext
-
isRefreshNeeded
public boolean isRefreshNeeded()Description copied from interface:CacheContext
Returns TRUE is a refresh is needed (missing / expired data)- Specified by:
isRefreshNeeded
in interfaceCacheContext
- Returns:
- TRUE if a refresh is required
-
isError
public boolean isError()Description copied from interface:CacheContext
Returns TRUE if the cache is in a error status- Specified by:
isError
in interfaceCacheContext
- Returns:
- TRUE if an exception is stored
-
getException
Description copied from interface:CacheContext
Returns the met exception- Specified by:
getException
in interfaceCacheContext
- Returns:
- an object with the exception and its occurrence time
-
isToBeDeleted
public boolean isToBeDeleted()Description copied from interface:CacheContext
Returns TRUE if the cache is in TO_BE_DELETED status- Specified by:
isToBeDeleted
in interfaceCacheContext
- Returns:
- TRUE if the entry must be deleted
-
isDesync
public boolean isDesync()Description copied from interface:CacheContext
Returns TRUE if the cache is in DESYNC status- Specified by:
isDesync
in interfaceCacheContext
- Returns:
- TRUE if the entry is desynchronized
-