Class TimerCache
java.lang.Object
de.fraunhofer.iese.mydata.pmp.cache.TimerCache
- All Implemented Interfaces:
ITimerCache
Keeps a copy of a timer list
- Author:
- kelbert
-
Constructor Summary
ConstructorDescriptionTimerCache
(Supplier<Instant> instantSupplier, String cachePath, Duration maxCacheAge) -
Method Summary
Modifier and TypeMethodDescriptionvoid
invalidates the cacheboolean
isValid()
boolean
updateCache
(Set<Timer> policies) updates cache content and refreshes validation timevoid
validate()
refreshes validation time of the cache without changing its contents
-
Constructor Details
-
TimerCache
public TimerCache() -
TimerCache
-
-
Method Details
-
getTimers
- Specified by:
getTimers
in interfaceITimerCache
- Returns:
- the cached timers if cache is valid or else empty Optional
-
isValid
public boolean isValid()- Specified by:
isValid
in interfaceITimerCache
- Returns:
- whether the cache is valid
-
invalidate
public void invalidate()Description copied from interface:ITimerCache
invalidates the cache- Specified by:
invalidate
in interfaceITimerCache
-
validate
public void validate()Description copied from interface:ITimerCache
refreshes validation time of the cache without changing its contents- Specified by:
validate
in interfaceITimerCache
-
updateCache
Description copied from interface:ITimerCache
updates cache content and refreshes validation time- Specified by:
updateCache
in interfaceITimerCache
- Returns:
- whether updating the cache succeeded
-