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 implementation of the
AnnotationPointProcessor interface.
This class processes annotation points and manages their associated quality codes. It provides methods for retrieving legacy annotations and results of the processing.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultAnnotationProcessor(List<AnnotationQueryKey> queryKeys, String queryId) Constructs a newDefaultAnnotationProcessor. -
Method Summary
Modifier and TypeMethodDescriptionConverts the processed annotation points to legacy annotation objects.Retrieves the results of the annotation processing.voidCalled when all processing is complete.voidonError(QualityCode error) Handles a terminal error condition with a quality code.voidHandles a terminal error condition with an exception.booleanInitializes the processor with context information before processing begins.voidonKeyFailure(AnnotationQueryKey queryKey, QualityCode failureCode) Handles a failure specific to a query key.booleanonPointAvailable(AnnotationQueryKey queryKey, AnnotationPoint point) Processes a single temporal point.
-
Constructor Details
-
DefaultAnnotationProcessor
Constructs a newDefaultAnnotationProcessor.Initializes the quality codes for the provided annotation query keys and sets up the logger.
- Parameters:
queryKeys- A list of annotation query keys to initialize with a default quality code.queryId- A unique identifier for the logger context.
-
-
Method Details
-
getAsLegacyAnnotations
Converts the processed annotation points to legacy annotation objects.- Returns:
- A list of legacy
Annotationobjects.
-
getResults
Retrieves the results of the annotation processing.If the result quality is good, returns the processed annotation points. Otherwise, returns an error result.
- Returns:
- A
Resultsobject containing the annotation points or an error.
-
onInitialize
Description copied from interface:QueriedPointProcessorInitializes the processor with context information before processing begins. This method is called once before any points are processed.- Specified by:
onInitializein interfaceQueriedPointProcessor<AnnotationPoint,AnnotationQueryKey, ComplexPointType> - Parameters:
context- The processing context containing initialization properties.- Returns:
- True if initialization was successful and processing should continue, false to stop.
-
onPointAvailable
Description copied from interface:QueriedPointProcessorProcesses a single temporal point. Called repeatedly for each point in the result set.- Specified by:
onPointAvailablein interfaceQueriedPointProcessor<AnnotationPoint,AnnotationQueryKey, ComplexPointType> - Parameters:
queryKey- The query key associated with the point.point- The temporal point to process.- Returns:
- True to continue processing additional points, false to stop.
-
onKeyFailure
Description copied from interface:QueriedPointProcessorHandles a failure specific to a query key. Processing continues for other query keys after this is called. This method can be called prior toQueriedPointProcessor.onInitialize(ProcessingContext)as needed.- Specified by:
onKeyFailurein interfaceQueriedPointProcessor<AnnotationPoint,AnnotationQueryKey, ComplexPointType> - Parameters:
queryKey- The query key that failed.failureCode- The quality code indicating the reason for failure.
-
onError
Description copied from interface:QueriedPointProcessorHandles a terminal error condition with a quality code. Processing stops after this method is called.- Specified by:
onErrorin interfaceQueriedPointProcessor<AnnotationPoint,AnnotationQueryKey, ComplexPointType> - Parameters:
error- The quality code representing the error condition.
-
onError
Description copied from interface:QueriedPointProcessorHandles a terminal error condition with an exception. Processing stops after this method is called.- Specified by:
onErrorin interfaceQueriedPointProcessor<AnnotationPoint,AnnotationQueryKey, ComplexPointType> - Parameters:
error- The exception that caused the error.
-
onComplete
public void onComplete()Description copied from interface:QueriedPointProcessorCalled when all processing is complete. This method is called exactly once after all points have been processed or processing has been stopped.- Specified by:
onCompletein interfaceQueriedPointProcessor<AnnotationPoint,AnnotationQueryKey, ComplexPointType>
-