Class DefaultAnnotationProcessor
java.lang.Object
com.inductiveautomation.historian.gateway.api.query.processor.DefaultAnnotationProcessor
- All Implemented Interfaces:
AnnotationPointProcessor, ComplexPointProcessor<AnnotationPoint, AnnotationQueryKey>, QueriedPointProcessor<AnnotationPoint, AnnotationQueryKey, ComplexPointType>
Default
AnnotationPointProcessor: processes annotation points, tracks a quality code per
key, and exposes the results, including as tag history Annotations.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultAnnotationProcessor(List<AnnotationQueryKey> queryKeys, String queryId) -
Method Summary
Modifier and TypeMethodDescriptionReturns the processed annotation points as tag historyAnnotations.Returns the processed annotation 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(AnnotationQueryKey queryKey, QualityCode failureCode) Called when one query key fails; processing continues for the other keys.booleanonPointAvailable(AnnotationQueryKey queryKey, AnnotationPoint 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
-
DefaultAnnotationProcessor
- Parameters:
queryKeys- the annotation query keys, each starting with a default quality codequeryId- the id used in the logger context
-
-
Method Details
-
getAsLegacyAnnotations
Returns the processed annotation points as tag historyAnnotations. -
getResults
Returns the processed annotation 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<AnnotationPoint, AnnotationQueryKey, 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<AnnotationPoint, AnnotationQueryKey, 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<AnnotationPoint, AnnotationQueryKey, 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<AnnotationPoint, AnnotationQueryKey, 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<AnnotationPoint, AnnotationQueryKey, 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<AnnotationPoint, AnnotationQueryKey, ComplexPointType>
-