edu.sc.seis.sod.source.event
Class AbstractEventSource

java.lang.Object
  extended by edu.sc.seis.sod.source.AbstractSource
      extended by edu.sc.seis.sod.source.event.AbstractEventSource
All Implemented Interfaces:
SodElement, EventSource, Source
Direct Known Subclasses:
FdsnEvent

public abstract class AbstractEventSource
extends AbstractSource
implements EventSource


Field Summary
protected  TimeInterval increment
           
protected  TimeInterval lag
           
static java.lang.String NO_DNS
           
protected  TimeInterval refreshInterval
           
protected  MicroSecondDate sleepUntilTime
           
 
Constructor Summary
AbstractEventSource(org.w3c.dom.Element config, java.lang.String defaultName)
           
AbstractEventSource(java.lang.String name, int retries)
           
 
Method Summary
protected  boolean caughtUpWithRealtime()
           
protected  MicroSecondDate getQueryEdge()
           
protected  MicroSecondDate getQueryStart()
           
protected  MicroSecondTimeRange getQueryTime()
           
 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.
protected  void resetQueryTimeForLag()
          Scoots the query time back by the event lag amount from the run properties to the query start time at the earliest
protected  void setQueryEdge(MicroSecondDate edge)
          sets the latest time queried
protected  void updateQueryEdge(MicroSecondTimeRange queryTime)
           
 
Methods inherited from class edu.sc.seis.sod.source.AbstractSource
getFissuresNamingService, getName, getRetries
 
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
 

Field Detail

NO_DNS

public static final java.lang.String NO_DNS
See Also:
Constant Field Values

sleepUntilTime

protected MicroSecondDate sleepUntilTime

increment

protected TimeInterval increment

lag

protected TimeInterval lag

refreshInterval

protected TimeInterval refreshInterval
Constructor Detail

AbstractEventSource

public AbstractEventSource(java.lang.String name,
                           int retries)

AbstractEventSource

public AbstractEventSource(org.w3c.dom.Element config,
                           java.lang.String defaultName)
Method Detail

getWaitBeforeNext

public 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 interface EventSource

caughtUpWithRealtime

protected boolean caughtUpWithRealtime()

getQueryStart

protected MicroSecondDate getQueryStart()
Returns:
- the next time to start asking for events

getQueryTime

protected MicroSecondTimeRange getQueryTime()
Returns:
- the next time range to be queried for events

resetQueryTimeForLag

protected void 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 MicroSecondDate getQueryEdge()
                                throws NotFound
Returns:
- latest time queried
Throws:
NotFound

setQueryEdge

protected void setQueryEdge(MicroSecondDate edge)
sets the latest time queried


updateQueryEdge

protected void updateQueryEdge(MicroSecondTimeRange queryTime)