public class TimestampGenerator extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
TimestampGenerator.TimeChangeListener
Listener used to get notification when a new event comes in.
|
| Constructor and Description |
|---|
TimestampGenerator(SiddhiAppContext siddhiAppContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTimeChangeListener(TimestampGenerator.TimeChangeListener listener)
Register to listen for time changes.
|
long |
currentTime() |
void |
setCurrentTimestamp(long timestamp)
Set the timestamp and notify the interested listeners.
|
void |
setIdleTime(long idleTime)
The
ScheduledExecutorService waits 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. |
void |
setIncrementInMilliseconds(long incrementInMilliseconds)
Set by how many milliseconds, the event timestamp should be increased.
|
public TimestampGenerator(SiddhiAppContext siddhiAppContext)
public long currentTime()
public void setCurrentTimestamp(long timestamp)
timestamp - the timestamp to the TimestampGeneratorpublic void setIdleTime(long idleTime)
ScheduledExecutorService waits 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.idleTime - the ideal time for wait until from the timestamp of last event.public void setIncrementInMilliseconds(long incrementInMilliseconds)
incrementInMilliseconds - the timestamp incremental value.public void addTimeChangeListener(TimestampGenerator.TimeChangeListener listener)
listener - any listeners interested on time change.SchedulerCopyright © 2018 WSO2. All rights reserved.