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 TimestampGenerator
public void setCurrentTimestamp(long timestamp)
setCurrentTimestamp
in interface TimestampGenerator
timestamp
- the timestamp to the TimestampGenerator
public 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 TimestampGenerator
idleTime
- the ideal time for wait until from the timestamp of last event.public void setIncrementInMilliseconds(long incrementInMilliseconds)
setIncrementInMilliseconds
in interface TimestampGenerator
incrementInMilliseconds
- the timestamp incremental value.public void addTimeChangeListener(TimestampGeneratorImpl.TimeChangeListener listener)
addTimeChangeListener
in interface TimestampGenerator
listener
- any listeners interested on time change.Scheduler
Copyright © 2021. All rights reserved.