stella.sensor
Interface DataCollecting

All Known Implementing Classes:
AbstractDataCollector, DatabaseCurrent, FileCurrent

public interface DataCollecting

Data collectors are only used by a SensorRepository. After collecting some sensor datas, this class averages over the data collected and calls its registered data collectors processData(java.util.Map, boolean) method. The data collectors are responsible for further processing the data, e.g. they can write it into a data-base or display it graphically.


Method Summary
 long getInterval()
          Returns the intervall in which the listener wants to be notified.
 void processData(Map<String,DataEvent> sensors, boolean weather)
          This method is called after the ShortAverageRepository collected some data.
 

Method Detail

processData

void processData(Map<String,DataEvent> sensors,
                 boolean weather)
This method is called after the ShortAverageRepository collected some data. In the argument, all sensors that have at least once in the liftime of the repository delivered data are mapped against the average DataEvent of all data events sent during the averaging period. Note that it is in principle possible that the sensor mapped has not produced a single data event in the last averaging period and therfore is mapped to null.
Note that the intervall at which the ShortAverageRepository is calling this method depends on the multiplyer to the repositorys base frequence delivered by the getInterval() method.

Parameters:
sensors - Mapping sensor names to data events.
weather - True if current weather is good.

getInterval

long getInterval()
Returns the intervall in which the listener wants to be notified. This is devided by the repositories base intervall to yield the number of averaged data events used for notification. Notificatioin is done using the last xx averaged data events produced, thus it is an average-of-averages, which is perfectly okay since we only consider averages and min/max, but no 2nd or higher order moments.