Package edu.sc.seis.sod.source.event
Class BackwardsEventSource
java.lang.Object
edu.sc.seis.sod.source.AbstractSource
edu.sc.seis.sod.source.event.AbstractEventSource
edu.sc.seis.sod.source.event.BackwardsEventSource
- All Implemented Interfaces:
EventSource
,Source
public class BackwardsEventSource extends AbstractEventSource
-
Field Summary
Fields inherited from class edu.sc.seis.sod.source.event.AbstractEventSource
caughtUpToRealtime, EVENT_LAG, EVENT_QUERY_INCREMENT, EVENT_REFRESH_INTERVAL, everCaughtUpToRealtime, increment, lag, lastQueryTime, MIN_INCREMENT, nearRealTimeInterval, refreshInterval, sleepUntilTime
Fields inherited from class edu.sc.seis.sod.source.AbstractSource
name, NAME_ELEMENT, RETRIES_ELEMENT
-
Constructor Summary
Constructors Modifier Constructor Description protected
BackwardsEventSource(EventSource source)
BackwardsEventSource(org.w3c.dom.Element config)
-
Method Summary
Modifier and Type Method Description protected boolean
caughtUpWithRealtime()
edu.sc.seis.sod.model.common.TimeRange
getEventTimeRange()
protected java.time.Instant
getQueryStart()
protected edu.sc.seis.sod.model.common.TimeRange
getQueryTime()
boolean
hasNext()
edu.sc.seis.sod.model.event.CacheEvent[]
next()
protected void
updateQueryEdge(edu.sc.seis.sod.model.common.TimeRange queryTime)
Methods inherited from class edu.sc.seis.sod.source.event.AbstractEventSource
decreaseQueryTimeWidth, getIncrement, getLag, getQueryEdge, getRefreshInterval, getSleepUntilTime, getWaitBeforeNext, increaseQueryTimeWidth, isEverCaughtUpToRealtime, resetQueryTimeForLag, setIncrement, setLag, setQueryEdge
Methods inherited from class edu.sc.seis.sod.source.AbstractSource
appendToName, getName, getRetries, getRetryStrategy, setRetryStrategy
-
Constructor Details
-
Method Details
-
getEventTimeRange
public edu.sc.seis.sod.model.common.TimeRange getEventTimeRange()- Returns:
- - a MicroSecondTimeRange starting at least as early as the earliest event and ending at least as late as the latest event. No event should be returned by this source with an origin before the begin time or after the end time of this range.
-
hasNext
public boolean hasNext()- Returns:
- - false when this event source will return no new events from calls to next
-
next
public edu.sc.seis.sod.model.event.CacheEvent[] next()- Returns:
- - the next set of events. Events can be returned from this method multiple times
-
caughtUpWithRealtime
protected boolean caughtUpWithRealtime()- Overrides:
caughtUpWithRealtime
in classAbstractEventSource
-
updateQueryEdge
protected void updateQueryEdge(edu.sc.seis.sod.model.common.TimeRange queryTime)- Overrides:
updateQueryEdge
in classAbstractEventSource
-
getQueryStart
protected java.time.Instant getQueryStart()- Overrides:
getQueryStart
in classAbstractEventSource
- Returns:
- - the next time to start asking for events
-
getQueryTime
protected edu.sc.seis.sod.model.common.TimeRange getQueryTime()- Overrides:
getQueryTime
in classAbstractEventSource
- Returns:
- - the next time range to be queried for events
-