Class DefaultTimeService
java.lang.Object
de.hybris.platform.servicelayer.internal.service.AbstractService
de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
de.hybris.platform.servicelayer.time.impl.DefaultTimeService
- All Implemented Interfaces:
TimeService,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
Default implementation of
TimeService- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO -
Field Summary
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManagerFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the adjusted current time relative to the time set byTimeService.setCurrentTime(Date)with time part normalized to 0.Returns the adjusted current time relative to the time set byTimeService.setCurrentTime(Date).longReturns the time offset in milliseconds, which is the time difference between the system time whenTimeService.setCurrentTime(Date)is called and the argument passed to theTimeService.setCurrentTime(Date)voidReset the time back to system time.voidsetCurrentTime(Date instant) Set the current time to the specified time instant.voidsetI18nService(I18NService i18nService) voidsetTimeOffset(long timeOffsetMillis) Set the time offset in milliseconds.Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
Constructor Details
-
DefaultTimeService
public DefaultTimeService()
-
-
Method Details
-
setCurrentTime
Description copied from interface:TimeServiceSet the current time to the specified time instant.- Specified by:
setCurrentTimein interfaceTimeService
-
getCurrentTime
Description copied from interface:TimeServiceReturns the adjusted current time relative to the time set byTimeService.setCurrentTime(Date). IfTimeService.setCurrentTime(Date)was never called earlier, then current system time is returned.- Specified by:
getCurrentTimein interfaceTimeService
-
getCurrentDateWithTimeNormalized
Description copied from interface:TimeServiceReturns the adjusted current time relative to the time set byTimeService.setCurrentTime(Date)with time part normalized to 0. IfTimeService.setCurrentTime(Date)was never called earlier, then current system time is returned.- Specified by:
getCurrentDateWithTimeNormalizedin interfaceTimeService
-
getTimeOffset
public long getTimeOffset()Description copied from interface:TimeServiceReturns the time offset in milliseconds, which is the time difference between the system time whenTimeService.setCurrentTime(Date)is called and the argument passed to theTimeService.setCurrentTime(Date)- Specified by:
getTimeOffsetin interfaceTimeService
-
resetTimeOffset
public void resetTimeOffset()Description copied from interface:TimeServiceReset the time back to system time. CallingTimeService.getTimeOffset()after calling this method will get a value of 0. This is equivalent to callingTimeService.setTimeOffset(long)with a zero value argument.- Specified by:
resetTimeOffsetin interfaceTimeService
-
setTimeOffset
public void setTimeOffset(long timeOffsetMillis) Description copied from interface:TimeServiceSet the time offset in milliseconds. Subsequent call toTimeService.getCurrentTime()will return the system time plus the offset.- Specified by:
setTimeOffsetin interfaceTimeService- Parameters:
timeOffsetMillis- time offset in milliseconds. Use a negative value to adjust time backwards.
-
setI18nService
-