Package com.evolveum.midpoint.common
Class Clock
java.lang.Object
com.evolveum.midpoint.common.Clock
System-wide clock. This class provides current time. By default is only proxies the usual system
 current time functions. But it may be explicitly manipulated to artificially shift the time. This
 of little value for a running system but it is really useful in the tests. Especially tests that
 test time-based behavior. Using the Clock avoids changing the actual system time (or JVM's perception
 of time) therefore the tests are easier to use and usual tools still make sense (e.g. log record timestamps
 are correct).
- Author:
- Radovan Semancik
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionlongstatic Clockget()voidinit()booleanisFuture(long date) booleanisFuture(XMLGregorianCalendar date) booleanisPast(long date) booleanisPast(XMLGregorianCalendar date) voidoverride(long overrideTimestamp) voidoverride(XMLGregorianCalendar overrideTimestamp) voidoverrideDuration(Long offsetMillis) Extends offset on top of existing offset.voidoverrideDuration(String durationString) Extends offset on top of existing offset.voidoverrideDuration(Duration duration) Extends offset on top of existing offset.voidoverrideOffset(Long offsetMillis) void
- 
Constructor Details- 
Clockpublic Clock()
 
- 
- 
Method Details- 
init@PostConstruct public void init()
- 
get
- 
currentTimeMillispublic long currentTimeMillis()
- 
currentTimeXMLGregorianCalendar
- 
isPastpublic boolean isPast(long date) 
- 
isPast
- 
isFuturepublic boolean isFuture(long date) 
- 
isFuture
- 
overridepublic void override(long overrideTimestamp) 
- 
override
- 
overrideDurationExtends offset on top of existing offset.
- 
overrideDurationExtends offset on top of existing offset.
- 
overrideDurationExtends offset on top of existing offset.
- 
overrideOffset
- 
resetOverridepublic void resetOverride()
 
-