All Known Implementing Classes:
DataCollectorDelegate.NodeSessionDelegate, DataCollectorFactory.AbstractDataCollector.AbstractNodeSession, DataCollectorFactory.AbstractDataCollector.ManualNodeSession, DataCollectorFactory.AbstractDataCollector.StreamingNodeSession, ErroredNodeSession

public interface DataNodeSession
Represents the session for interacting with a data node. Provides operations for managing changes to data, metadata, and source as well as managing the lifecycle of the node session. DataNodeSession implementations are responsible for ensuring proper handling of resources and state transitions in the life cycle of the node session.
  • Method Details

    • getAvailabilityStatus

      DataNodeSession.AvailabilityStatus getAvailabilityStatus()
      Gets the current availability status of the node.
      Returns:
      The current DataNodeSession.AvailabilityStatus of the node.
    • processDataChange

      CompletionStage<QualityCode> processDataChange(DataPoint<?> dataPoint)
      Processes a data change for the node.
      Parameters:
      dataPoint - The new DataPoint containing the data change for the node.
      Returns:
      A CompletionStage that, when completed, provides the QualityCode of the operation. If the node's availability status is UNSUPPORTED, this will complete with QualityCode.Bad_Unsupported.
      Throws:
      SourcePathMismatchException - If the source path in the data point doesn't match the path this session represents.
    • processSourceChange

      CompletionStage<QualityCode> processSourceChange(SourceChangePoint sourceChange)
      Processes a change in the source configuration or state for the node.
      Parameters:
      sourceChange - The SourceChangePoint representing the source change to process.
      Returns:
      A CompletionStage that, when completed, provides the QualityCode of the operation. If the node's availability status is UNSUPPORTED, this will complete with QualityCode.Bad_Unsupported.
      Throws:
      SourcePathMismatchException - If the old source path in the source change doesn't match the path this session represents.
    • retireNode

      Retires the node, indicating no further data changes are expected. After calling this method, it is expected that release() will be called subsequently to properly clean up resources.
      Returns:
      A CompletionStage that, when completed, provides the QualityCode of the operation. If the node's availability status is UNSUPPORTED, this will complete with QualityCode.Bad_Unsupported.
      See Also:
    • processMetadataChange

      CompletionStage<QualityCode> processMetadataChange(MetadataPoint metadata)
      Processes a metadata change for the node.
      Parameters:
      metadata - The MetadataPoint containing the metadata change to process.
      Returns:
      A CompletionStage that, when completed, provides the QualityCode of the operation. If the node's availability status is UNSUPPORTED, this will complete with QualityCode.Bad_Unsupported.
      Throws:
      SourcePathMismatchException - If the source path in the metadata point doesn't match the path this session represents.
    • reset

      Resets the current session for the node to its initial state. This operation may involve clearing any cached data.
      Returns:
      A CompletionStage that, when completed, provides the QualityCode indicating the result of the reset operation. If the node's availability status is UNSUPPORTED, this will complete with QualityCode.Bad_Unsupported.
    • release

      void release()
      Closes the session, releasing any resources associated with it.

      This method ensures that any resources allocated during the session's lifecycle are properly released. It should be called after retireNode() to complete the cleanup process and prevent resource leaks.

    • attachObserver

      boolean attachObserver(NodeSessionObserver observer)
      Attaches a NodeSessionObserver to the node session. This allows the observer to receive updates about the session's state and events.
      Parameters:
      observer - The NodeSessionObserver to attach.
      Returns:
      true if the observer was successfully attached, false if already attached or if attachment failed.
    • detachObserver

      boolean detachObserver(NodeSessionObserver observer)
      Detaches a NodeSessionObserver from the node session. This stops the observer from receiving further updates about the session's state and events.
      Parameters:
      observer - The NodeSessionObserver to detach.
      Returns:
      true if the observer was successfully detached, false if not attached or if detachment failed.