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 implementation of the
MetadataPointProcessor interface.
This class processes metadata points and manages their associated quality codes. It provides methods for initialization, handling metadata points, and managing errors during the processing lifecycle.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultMetadataProcessor(List<MetadataQueryKey> keys, String identifier) Constructs a newDefaultMetadataProcessor. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the results of the metadata 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(MetadataQueryKey queryKey, QualityCode failureCode) Handles a failure specific to a query key.booleanonPointAvailable(MetadataQueryKey queryKey, MetadataPoint point) Processes a single temporal point.
-
Constructor Details
-
DefaultMetadataProcessor
Constructs a newDefaultMetadataProcessor.Initializes the quality codes for the provided metadata query keys and sets up the logger.
- Parameters:
keys- A list of metadata query keys to initialize with a default quality code.identifier- A unique identifier for the logger context.
-
-
Method Details
-
getResults
Retrieves the results of the metadata processing.If the result quality is good, returns the processed metadata points. Otherwise, returns an error result.
- Returns:
- A
Resultsobject containing the metadata 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<MetadataPoint,MetadataQueryKey, 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<MetadataPoint,MetadataQueryKey, 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<MetadataPoint,MetadataQueryKey, 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<MetadataPoint,MetadataQueryKey, 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<MetadataPoint,MetadataQueryKey, 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<MetadataPoint,MetadataQueryKey, ComplexPointType>
-