Class CurrentCacheContext

java.lang.Object
eu.europa.esig.dss.tsl.cache.state.CurrentCacheContext
All Implemented Interfaces:
CacheContext

public class CurrentCacheContext extends Object implements CacheContext
Contains information for a cache record state
  • Constructor Details

    • CurrentCacheContext

      public CurrentCacheContext()
      Default constructor
  • Method Details

    • getCurrentState

      public CacheStateEnum getCurrentState()
      Description copied from interface: CacheContext
      Returns the current state in the cache
      Specified by:
      getCurrentState in interface CacheContext
      Returns:
      the Cache state
    • getLastStateTransitionTime

      public Date getLastStateTransitionTime()
      Description copied from interface: CacheContext
      Returns the date of the last state transition
      Specified by:
      getLastStateTransitionTime in interface CacheContext
      Returns:
      the last date when the state has had a transition
    • getLastSuccessSynchronizationTime

      public Date 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 interface CacheContext
      Returns:
      the last date when the state has been synchronized
    • state

      public void state(CacheState newState)
      Description copied from interface: CacheContext
      This method operates a state change
      Specified by:
      state in interface CacheContext
      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 interface CacheContext
    • error

      public void error(CachedExceptionWrapper cachedException)
      Description copied from interface: CacheContext
      Store the exception for its occurrence time
      Specified by:
      error in interface CacheContext
      Parameters:
      cachedException - an instance of CachedExceptionWrapper
    • errorUpdateDate

      public void errorUpdateDate(CachedExceptionWrapper updatedException)
      Description copied from interface: CacheContext
      Store the last occurrence of this exception
      Specified by:
      errorUpdateDate in interface CacheContext
      Parameters:
      updatedException - an instance of CachedExceptionWrapper
    • desync

      public void desync()
      Description copied from interface: CacheContext
      Set the context as DESYNCHRONIZED
      Specified by:
      desync in interface CacheContext
    • sync

      public void sync()
      Description copied from interface: CacheContext
      Set the context as SYNCHRONIZED
      Specified by:
      sync in interface CacheContext
    • refreshNeeded

      public void refreshNeeded()
      Description copied from interface: CacheContext
      Set the context as REFRESH_NEEDED
      Specified by:
      refreshNeeded in interface CacheContext
    • toBeDeleted

      public void toBeDeleted()
      Description copied from interface: CacheContext
      Set the context as TO_BE_DELETED
      Specified by:
      toBeDeleted in interface CacheContext
    • isRefreshNeeded

      public boolean isRefreshNeeded()
      Description copied from interface: CacheContext
      Returns TRUE is a refresh is needed (missing / expired data)
      Specified by:
      isRefreshNeeded in interface CacheContext
      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 interface CacheContext
      Returns:
      TRUE if an exception is stored
    • getException

      public CachedExceptionWrapper getException()
      Description copied from interface: CacheContext
      Returns the met exception
      Specified by:
      getException in interface CacheContext
      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 interface CacheContext
      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 interface CacheContext
      Returns:
      TRUE if the entry is desynchronized