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

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

public class EventFinder
extends AbstractSource
implements EventSource


Field Summary
protected  TimeInterval increment
           
protected  TimeInterval lag
           
protected  TimeInterval refreshInterval
           
 
Constructor Summary
EventFinder(org.w3c.dom.Element config)
           
 
Method Summary
protected  boolean caughtUpWithRealtime()
           
 java.lang.String getDescription()
           
 MicroSecondTimeRange getEventTimeRange()
           
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.
 boolean hasNext()
           
 CacheEvent[] next()
           
protected  void processConfig(org.w3c.dom.Element config)
           
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
getDNS, getFissuresNamingService, getName, getRetries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

increment

protected TimeInterval increment

lag

protected TimeInterval lag

refreshInterval

protected TimeInterval refreshInterval
Constructor Detail

EventFinder

public EventFinder(org.w3c.dom.Element config)
            throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

processConfig

protected void processConfig(org.w3c.dom.Element config)
                      throws ConfigurationException
Throws:
ConfigurationException

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface EventSource

hasNext

public boolean hasNext()
Specified by:
hasNext in interface EventSource
Returns:
- false when this event source will return no new events from calls to next

next

public CacheEvent[] next()
Specified by:
next in interface EventSource
Returns:
- the next set of events. Events can be returned from this method multiple times

updateQueryEdge

protected void updateQueryEdge(MicroSecondTimeRange queryTime)

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()

getEventTimeRange

public MicroSecondTimeRange getEventTimeRange()
Specified by:
getEventTimeRange in interface EventSource
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.

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

getQueryEdge

protected MicroSecondDate getQueryEdge()
                                throws NotFound
Returns:
- latest time queried
Throws:
NotFound

setQueryEdge

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