Package edu.sc.seis.sod.source.event
Class AbstractEventSource
- java.lang.Object
-
- edu.sc.seis.sod.source.AbstractSource
-
- edu.sc.seis.sod.source.event.AbstractEventSource
-
- All Implemented Interfaces:
EventSource
,Source
- Direct Known Subclasses:
DelayedEventSource
,FdsnEvent
public abstract class AbstractEventSource extends AbstractSource implements EventSource
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
caughtUpToRealtime
static java.lang.String
EVENT_LAG
static java.lang.String
EVENT_QUERY_INCREMENT
static java.lang.String
EVENT_REFRESH_INTERVAL
protected boolean
everCaughtUpToRealtime
protected edu.iris.Fissures.model.TimeInterval
increment
protected edu.iris.Fissures.model.TimeInterval
lag
protected edu.iris.Fissures.model.MicroSecondDate
lastQueryTime
static edu.iris.Fissures.model.TimeInterval
MIN_INCREMENT
protected edu.iris.Fissures.model.TimeInterval
nearRealTimeInterval
static java.lang.String
NO_DNS
protected edu.iris.Fissures.model.TimeInterval
refreshInterval
protected edu.iris.Fissures.model.MicroSecondDate
sleepUntilTime
-
Fields inherited from class edu.sc.seis.sod.source.AbstractSource
name, NAME_ELEMENT, RETRIES_ELEMENT
-
-
Constructor Summary
Constructors Constructor Description AbstractEventSource(java.lang.String name, int retries)
AbstractEventSource(org.w3c.dom.Element config, java.lang.String defaultName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
caughtUpWithRealtime()
void
decreaseQueryTimeWidth()
decrease the time increment for queries, but only if it is larger than the minimum = 1Day to avoid many tiny queries to the server.edu.iris.Fissures.model.TimeInterval
getIncrement()
edu.iris.Fissures.model.TimeInterval
getLag()
protected edu.iris.Fissures.model.MicroSecondDate
getQueryEdge()
protected edu.iris.Fissures.model.MicroSecondDate
getQueryStart()
protected edu.sc.seis.fissuresUtil.time.MicroSecondTimeRange
getQueryTime()
edu.iris.Fissures.model.TimeInterval
getRefreshInterval()
edu.iris.Fissures.model.MicroSecondDate
getSleepUntilTime()
edu.iris.Fissures.model.TimeInterval
getWaitBeforeNext()
If the source needs to wait for more events to arrive, it should return the amount of time it wants to wait with this method.void
increaseQueryTimeWidth()
protected boolean
isEverCaughtUpToRealtime()
protected edu.iris.Fissures.model.MicroSecondDate
resetQueryTimeForLag()
Scoots the query time back by the event lag amount from the run properties to the query start time at the earliestvoid
setIncrement(edu.iris.Fissures.model.TimeInterval increment)
void
setLag(edu.iris.Fissures.model.TimeInterval lag)
protected void
setQueryEdge(edu.iris.Fissures.model.MicroSecondDate edge)
sets the latest time queriedprotected void
updateQueryEdge(edu.sc.seis.fissuresUtil.time.MicroSecondTimeRange queryTime)
-
Methods inherited from class edu.sc.seis.sod.source.AbstractSource
appendToName, getFissuresNamingService, getName, getRetries, getRetryStrategy, setRetryStrategy
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.sc.seis.sod.source.event.EventSource
getDescription, getEventTimeRange, hasNext, next
-
Methods inherited from interface edu.sc.seis.sod.source.Source
appendToName, getName, getRetries
-
-
-
-
Field Detail
-
caughtUpToRealtime
protected boolean caughtUpToRealtime
-
everCaughtUpToRealtime
protected boolean everCaughtUpToRealtime
-
lastQueryTime
protected edu.iris.Fissures.model.MicroSecondDate lastQueryTime
-
NO_DNS
public static final java.lang.String NO_DNS
- See Also:
- Constant Field Values
-
sleepUntilTime
protected edu.iris.Fissures.model.MicroSecondDate sleepUntilTime
-
increment
protected edu.iris.Fissures.model.TimeInterval increment
-
lag
protected edu.iris.Fissures.model.TimeInterval lag
-
refreshInterval
protected edu.iris.Fissures.model.TimeInterval refreshInterval
-
nearRealTimeInterval
protected edu.iris.Fissures.model.TimeInterval nearRealTimeInterval
-
EVENT_QUERY_INCREMENT
public static final java.lang.String EVENT_QUERY_INCREMENT
- See Also:
- Constant Field Values
-
EVENT_REFRESH_INTERVAL
public static final java.lang.String EVENT_REFRESH_INTERVAL
- See Also:
- Constant Field Values
-
EVENT_LAG
public static final java.lang.String EVENT_LAG
- See Also:
- Constant Field Values
-
MIN_INCREMENT
public static final edu.iris.Fissures.model.TimeInterval MIN_INCREMENT
-
-
Constructor Detail
-
AbstractEventSource
public AbstractEventSource(java.lang.String name, int retries)
-
AbstractEventSource
public AbstractEventSource(org.w3c.dom.Element config, java.lang.String defaultName) throws ConfigurationException
- Throws:
ConfigurationException
-
-
Method Detail
-
getWaitBeforeNext
public edu.iris.Fissures.model.TimeInterval getWaitBeforeNext()
Description copied from interface:EventSource
If the source needs to wait for more events to arrive, it should return the amount of time it wants to wait with this method.- Specified by:
getWaitBeforeNext
in interfaceEventSource
-
caughtUpWithRealtime
protected boolean caughtUpWithRealtime()
-
isEverCaughtUpToRealtime
protected boolean isEverCaughtUpToRealtime()
-
getQueryStart
protected edu.iris.Fissures.model.MicroSecondDate getQueryStart()
- Returns:
- - the next time to start asking for events
-
getQueryTime
protected edu.sc.seis.fissuresUtil.time.MicroSecondTimeRange getQueryTime()
- Returns:
- - the next time range to be queried for events
-
increaseQueryTimeWidth
public void increaseQueryTimeWidth()
-
decreaseQueryTimeWidth
public void decreaseQueryTimeWidth()
decrease the time increment for queries, but only if it is larger than the minimum = 1Day to avoid many tiny queries to the server.
-
resetQueryTimeForLag
protected edu.iris.Fissures.model.MicroSecondDate resetQueryTimeForLag()
Scoots the query time back by the event lag amount from the run properties to the query start time at the earliest
-
getQueryEdge
protected edu.iris.Fissures.model.MicroSecondDate getQueryEdge() throws edu.sc.seis.fissuresUtil.database.NotFound
- Returns:
- - latest time queried
- Throws:
edu.sc.seis.fissuresUtil.database.NotFound
-
setQueryEdge
protected void setQueryEdge(edu.iris.Fissures.model.MicroSecondDate edge)
sets the latest time queried
-
updateQueryEdge
protected void updateQueryEdge(edu.sc.seis.fissuresUtil.time.MicroSecondTimeRange queryTime)
-
getSleepUntilTime
public edu.iris.Fissures.model.MicroSecondDate getSleepUntilTime()
-
getLag
public edu.iris.Fissures.model.TimeInterval getLag()
-
getIncrement
public edu.iris.Fissures.model.TimeInterval getIncrement()
-
setIncrement
public void setIncrement(edu.iris.Fissures.model.TimeInterval increment)
-
setLag
public void setLag(edu.iris.Fissures.model.TimeInterval lag)
-
getRefreshInterval
public edu.iris.Fissures.model.TimeInterval getRefreshInterval()
-
-