Package com.streambase.sb
Interface TimeService
- 
public interface TimeServiceThis interface defines a contract that enables users to provide custom implementations of time used by StreamBase server It must be implemented by all Time Service classes.- Since:
 - 7.4
 
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidadvanceBy(long timeAdvance, TimeUnit timeUnit)Advances the service time by a certain number of time units in the future.voidadvanceTo(long targetTimeMsec)Make the service advance to a specific time in the futureTimestampgetFutureTimestamp(long targetAdvance, TimeUnit timeUnit)Get the time stamp of a time point based on the specific time advancelonggetTargetTime()Get the current time in milliseconds from the perspective of this time service 
 - 
 
- 
- 
Method Detail
- 
getTargetTime
long getTargetTime()
Get the current time in milliseconds from the perspective of this time service- Returns:
 - the current time in milliseconds
 
 
- 
advanceBy
void advanceBy(long timeAdvance, TimeUnit timeUnit) throws StreamBaseExceptionAdvances the service time by a certain number of time units in the future.- Parameters:
 timeAdvance- number of time units that the service should advance by. It should be a positive long valuetimeUnit- time unit- Throws:
 StreamBaseException
 
- 
advanceTo
void advanceTo(long targetTimeMsec) throws StreamBaseExceptionMake the service advance to a specific time in the future- Parameters:
 targetTimeMsec- Time to advance to. It must be greater than the service's current time- Throws:
 StreamBaseException
 
- 
getFutureTimestamp
Timestamp getFutureTimestamp(long targetAdvance, TimeUnit timeUnit)
Get the time stamp of a time point based on the specific time advance- Parameters:
 targetAdvance- time difference (in time units) between the future time point and the service's current time It must be 0 or a positive valuetimeUnit- time unit- Returns:
 - a time stamp
 
 
 - 
 
 -