Class DefaultMetadataProcessor
java.lang.Object
com.inductiveautomation.historian.gateway.api.query.processor.DefaultMetadataProcessor
- All Implemented Interfaces:
ComplexPointProcessor<MetadataPoint, MetadataQueryKey>, MetadataPointProcessor, QueriedPointProcessor<MetadataPoint, MetadataQueryKey, ComplexPointType>
Default
MetadataPointProcessor: processes metadata points, tracks a quality code per key,
and handles errors.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the processed metadata points if the result quality is good, otherwise an error result.voidCalled exactly once after all points have been processed or processing has stopped.voidonError(QualityCode error) Called on a terminal error given as a quality code; processing stops.voidCalled on a terminal error given as an exception; processing stops.booleanCalled once before any points are processed.voidonKeyFailure(MetadataQueryKey queryKey, QualityCode failureCode) Called when one query key fails; processing continues for the other keys.booleanonPointAvailable(MetadataQueryKey queryKey, MetadataPoint point) Called for each point in the result.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface QueriedPointProcessor
onWatermark, onWatermark
-
Constructor Details
-
DefaultMetadataProcessor
- Parameters:
keys- the metadata query keys, each starting with a default quality codeidentifier- the id used in the logger context
-
-
Method Details
-
getResults
Returns the processed metadata points if the result quality is good, otherwise an error result. -
onInitialize
Description copied from interface:QueriedPointProcessorCalled once before any points are processed.- Specified by:
onInitializein interfaceQueriedPointProcessor<MetadataPoint, MetadataQueryKey, ComplexPointType>- Parameters:
context- the processing context- Returns:
trueto continue processing,falseto stop
-
onPointAvailable
Description copied from interface:QueriedPointProcessorCalled for each point in the result.- Specified by:
onPointAvailablein interfaceQueriedPointProcessor<MetadataPoint, MetadataQueryKey, ComplexPointType>- Parameters:
queryKey- the key the point belongs topoint- the point to process- Returns:
trueto continue processing,falseto stop
-
onKeyFailure
Description copied from interface:QueriedPointProcessorCalled when one query key fails; processing continues for the other keys. May be called beforeQueriedPointProcessor.onInitialize(ProcessingContext).- Specified by:
onKeyFailurein interfaceQueriedPointProcessor<MetadataPoint, MetadataQueryKey, ComplexPointType>- Parameters:
queryKey- the failed keyfailureCode- the quality code giving the reason
-
onError
Description copied from interface:QueriedPointProcessorCalled on a terminal error given as a quality code; processing stops.- Specified by:
onErrorin interfaceQueriedPointProcessor<MetadataPoint, MetadataQueryKey, ComplexPointType>- Parameters:
error- the error
-
onError
Description copied from interface:QueriedPointProcessorCalled on a terminal error given as an exception; processing stops.- Specified by:
onErrorin interfaceQueriedPointProcessor<MetadataPoint, MetadataQueryKey, ComplexPointType>- Parameters:
error- the cause
-
onComplete
public void onComplete()Description copied from interface:QueriedPointProcessorCalled exactly once after all points have been processed or processing has stopped.- Specified by:
onCompletein interfaceQueriedPointProcessor<MetadataPoint, MetadataQueryKey, ComplexPointType>
-