Package io.siddhi.core.util.timestamp
Class TimestampGeneratorImpl
- java.lang.Object
-
- io.siddhi.core.util.timestamp.TimestampGeneratorImpl
-
- All Implemented Interfaces:
TimestampGenerator
public class TimestampGeneratorImpl extends Object implements TimestampGenerator
Class for timestamp generators. Provide event and system time generator based values.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceTimestampGeneratorImpl.TimeChangeListenerListener used to get notification when a new event comes in.
-
Constructor Summary
Constructors Constructor Description TimestampGeneratorImpl(SiddhiAppContext siddhiAppContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTimeChangeListener(TimestampGeneratorImpl.TimeChangeListener listener)Register to listen for time changes.longcurrentTime()voidsetCurrentTimestamp(long timestamp)Set the timestamp and notify the interested listeners.voidsetIdleTime(long idleTime)TheScheduledExecutorServicewaits until idleTime from the timestamp of last event and if there are no new events arrived within that period, it will inject a new timestamp.voidsetIncrementInMilliseconds(long incrementInMilliseconds)Set by how many milliseconds, the event timestamp should be increased.
-
-
-
Constructor Detail
-
TimestampGeneratorImpl
public TimestampGeneratorImpl(SiddhiAppContext siddhiAppContext)
-
-
Method Detail
-
currentTime
public long currentTime()
- Specified by:
currentTimein interfaceTimestampGenerator
-
setCurrentTimestamp
public void setCurrentTimestamp(long timestamp)
Set the timestamp and notify the interested listeners.- Specified by:
setCurrentTimestampin interfaceTimestampGenerator- Parameters:
timestamp- the timestamp to theTimestampGenerator
-
setIdleTime
public void setIdleTime(long idleTime)
TheScheduledExecutorServicewaits until idleTime from the timestamp of last event and if there are no new events arrived within that period, it will inject a new timestamp.- Specified by:
setIdleTimein interfaceTimestampGenerator- Parameters:
idleTime- the ideal time for wait until from the timestamp of last event.
-
setIncrementInMilliseconds
public void setIncrementInMilliseconds(long incrementInMilliseconds)
Set by how many milliseconds, the event timestamp should be increased.- Specified by:
setIncrementInMillisecondsin interfaceTimestampGenerator- Parameters:
incrementInMilliseconds- the timestamp incremental value.
-
addTimeChangeListener
public void addTimeChangeListener(TimestampGeneratorImpl.TimeChangeListener listener)
Register to listen for time changes.- Specified by:
addTimeChangeListenerin interfaceTimestampGenerator- Parameters:
listener- any listeners interested on time change.- See Also:
Scheduler
-
-