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.
  • Method Details

    • getAvailabilityStatus

      DataNodeSession.AvailabilityStatus getAvailabilityStatus()
      Returns the node's current availability status.
    • processDataChange

      CompletionStage<QualityCode> processDataChange(DataPoint<?> dataPoint)
      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

      CompletionStage<QualityCode> processSourceChange(SourceChangePoint sourceChange)
      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

      Retires the node: no further data changes are expected, and the caller then calls release().
      Returns:
      the quality of the operation
    • processMetadataChange

      CompletionStage<QualityCode> processMetadataChange(MetadataPoint metadata)
      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

      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 after retireNode().
    • attachObserver

      boolean attachObserver(NodeSessionObserver observer)
      Attaches an observer of the session's state and events.
      Parameters:
      observer - the observer to attach
      Returns:
      true if attached, false if already attached or attachment failed
    • detachObserver

      boolean detachObserver(NodeSessionObserver observer)
      Detaches an observer.
      Parameters:
      observer - the observer to detach
      Returns:
      true if detached, false if not attached or detachment failed