Interface DataNodeSession
- All Known Implementing Classes:
DataCollectorDelegate.NodeSessionDelegate, DataCollectorFactory.AbstractDataCollector.AbstractNodeSession, DataCollectorFactory.AbstractDataCollector.ManualNodeSession, DataCollectorFactory.AbstractDataCollector.StreamingNodeSession, ErroredNodeSession
public interface DataNodeSession
A session for one data node: applies data, source and metadata changes to it, and ends with
retireNode() followed by release(). Every change method completes with the
QualityCode of the operation, or Bad_Unsupported when the node's availability
status is UNSUPPORTED.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe availability of a node. -
Method Summary
Modifier and TypeMethodDescriptionbooleanattachObserver(NodeSessionObserver observer) Attaches an observer of the session's state and events.booleandetachObserver(NodeSessionObserver observer) Detaches an observer.Returns the node's current availability status.processDataChange(DataPoint<?> dataPoint) Applies a data change to the node.processMetadataChange(MetadataPoint metadata) Applies a metadata change to the node.processSourceChange(SourceChangePoint sourceChange) Applies a source change to the node.voidrelease()Releases the session's resources.reset()Resets the session to its initial state, clearing any cached data.Retires the node: no further data changes are expected, and the caller then callsrelease().
-
Method Details
-
getAvailabilityStatus
DataNodeSession.AvailabilityStatus getAvailabilityStatus()Returns the node's current availability status. -
processDataChange
Applies a data change to the node.- Parameters:
dataPoint- the data change- Returns:
- the quality of the operation
- Throws:
SourcePathMismatchException- if the point's source path is not the path this session represents
-
processSourceChange
Applies a source change to the node.- Parameters:
sourceChange- the source change- Returns:
- the quality of the operation
- Throws:
SourcePathMismatchException- if the change's old source path is not the path this session represents
-
retireNode
CompletionStage<QualityCode> retireNode()Retires the node: no further data changes are expected, and the caller then callsrelease().- Returns:
- the quality of the operation
-
processMetadataChange
Applies a metadata change to the node.- Parameters:
metadata- the metadata change- Returns:
- the quality of the operation
- Throws:
SourcePathMismatchException- if the point's source path is not the path this session represents
-
reset
CompletionStage<QualityCode> reset()Resets the session to its initial state, clearing any cached data.- Returns:
- the quality of the operation
-
release
void release()Releases the session's resources. Call it afterretireNode(). -
attachObserver
Attaches an observer of the session's state and events.- Parameters:
observer- the observer to attach- Returns:
trueif attached,falseif already attached or attachment failed
-
detachObserver
Detaches an observer.- Parameters:
observer- the observer to detach- Returns:
trueif detached,falseif not attached or detachment failed
-