public class TimestampGeneratorImpl extends Object implements TimestampGenerator
| Modifier and Type | Class and Description |
|---|---|
static interface |
TimestampGeneratorImpl.TimeChangeListener
Listener used to get notification when a new event comes in.
|
| Constructor and Description |
|---|
TimestampGeneratorImpl(SiddhiAppContext siddhiAppContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTimeChangeListener(TimestampGeneratorImpl.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 TimestampGeneratorImpl(SiddhiAppContext siddhiAppContext)
public long currentTime()
currentTime in interface TimestampGeneratorpublic void setCurrentTimestamp(long timestamp)
setCurrentTimestamp in interface TimestampGeneratortimestamp - 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.setIdleTime in interface TimestampGeneratoridleTime - the ideal time for wait until from the timestamp of last event.public void setIncrementInMilliseconds(long incrementInMilliseconds)
setIncrementInMilliseconds in interface TimestampGeneratorincrementInMilliseconds - the timestamp incremental value.public void addTimeChangeListener(TimestampGeneratorImpl.TimeChangeListener listener)
addTimeChangeListener in interface TimestampGeneratorlistener - any listeners interested on time change.SchedulerCopyright © 2019 WSO2. All rights reserved.