Class TagAggregateProcessor<T extends DataProcessor>
- java.lang.Object
-
- com.inductiveautomation.gateway.tags.history.processing.TagAggregateProcessor<T>
-
- All Implemented Interfaces:
DataHandler
,DataProcessor
public class TagAggregateProcessor<T extends DataProcessor> extends java.lang.Object implements DataProcessor
Processes values broken up by tag id. Operates on the notion that takeProcessed will be called directly after putValue. With this in mind, the system can hold the last processor and go to it, preventing the need to loop through all processors looking for changes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
TagAggregateProcessor.DataProcessorFactory<T>
-
Constructor Summary
Constructors Constructor Description TagAggregateProcessor(TagAggregateProcessor.DataProcessorFactory<T> factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
flush()
Indicate that the handler won't get any more data, at least for a while.java.util.Collection<T>
getDataProcessors()
protected T
getProcessor(java.lang.Integer tagId)
void
putValue(RawTagValue inValue)
Insert a value into the handler.java.util.List<RawTagValue>
takeProcessed()
Returns processed values, if any are ready.
-
-
-
Constructor Detail
-
TagAggregateProcessor
public TagAggregateProcessor(TagAggregateProcessor.DataProcessorFactory<T> factory)
-
-
Method Detail
-
getDataProcessors
public java.util.Collection<T> getDataProcessors()
-
getProcessor
protected T getProcessor(java.lang.Integer tagId)
-
putValue
public void putValue(RawTagValue inValue) throws java.lang.Exception
Description copied from interface:DataHandler
Insert a value into the handler.- Specified by:
putValue
in interfaceDataHandler
- Throws:
java.lang.Exception
-
takeProcessed
public java.util.List<RawTagValue> takeProcessed()
Description copied from interface:DataProcessor
Returns processed values, if any are ready. Otherwise returns null. Should also be called after flush to get any remaining values.- Specified by:
takeProcessed
in interfaceDataProcessor
-
flush
public void flush() throws java.lang.Exception
Description copied from interface:DataHandler
Indicate that the handler won't get any more data, at least for a while.- Specified by:
flush
in interfaceDataHandler
- Throws:
java.lang.Exception
-
-