Class DataCollectorFactory.AbstractDataCollector.AbstractNodeSession
java.lang.Object
com.inductiveautomation.historian.gateway.api.storage.realtime.DataCollectorFactory.AbstractDataCollector.AbstractNodeSession
- All Implemented Interfaces:
DataNodeSession
- Direct Known Subclasses:
DataCollectorFactory.AbstractDataCollector.ManualNodeSession
,DataCollectorFactory.AbstractDataCollector.StreamingNodeSession
- Enclosing class:
- DataCollectorFactory.AbstractDataCollector
protected abstract class DataCollectorFactory.AbstractDataCollector.AbstractNodeSession
extends Object
implements DataNodeSession
Base abstract class for node session implementations that provides common functionality
for both streaming and manual collection modes.
A node session represents a connection to a specific data source and manages the state related to that source, including observer registration, source changes, and session lifecycle. It tracks the current source path and provides methods for collecting data points during collection operations.
Subclasses implement specific behaviors for different collection modes, determining how data and metadata changes are processed and stored.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.inductiveautomation.historian.gateway.api.storage.realtime.DataNodeSession
DataNodeSession.AvailabilityStatus
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
attachObserver
(NodeSessionObserver observer) Attaches aNodeSessionObserver
to the node session.boolean
detachObserver
(NodeSessionObserver observer) Detaches aNodeSessionObserver
from the node session.Gets the current availability status of the node.processSourceChange
(SourceChangePoint sourceChange) Processes a change in the source configuration or state for the node.void
release()
Closes the session, releasing any resources associated with it.Retires the node, indicating no further data changes are expected.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.inductiveautomation.historian.gateway.api.storage.realtime.DataNodeSession
processDataChange, processMetadataChange, reset
-
Constructor Details
-
AbstractNodeSession
-
-
Method Details
-
attachObserver
Description copied from interface:DataNodeSession
Attaches aNodeSessionObserver
to the node session. This allows the observer to receive updates about the session's state and events.- Specified by:
attachObserver
in interfaceDataNodeSession
- Parameters:
observer
- TheNodeSessionObserver
to attach.- Returns:
true
if the observer was successfully attached,false
if already attached or if attachment failed.
-
detachObserver
Description copied from interface:DataNodeSession
Detaches aNodeSessionObserver
from the node session. This stops the observer from receiving further updates about the session's state and events.- Specified by:
detachObserver
in interfaceDataNodeSession
- Parameters:
observer
- TheNodeSessionObserver
to detach.- Returns:
true
if the observer was successfully detached,false
if not attached or if detachment failed.
-
getAvailabilityStatus
Description copied from interface:DataNodeSession
Gets the current availability status of the node.- Specified by:
getAvailabilityStatus
in interfaceDataNodeSession
- Returns:
- The current
DataNodeSession.AvailabilityStatus
of the node.
-
processSourceChange
Description copied from interface:DataNodeSession
Processes a change in the source configuration or state for the node.- Specified by:
processSourceChange
in interfaceDataNodeSession
- Parameters:
sourceChange
- TheSourceChangePoint
representing the source change to process.- Returns:
- A
CompletionStage
that, when completed, provides theQualityCode
of the operation. If the node's availability status isUNSUPPORTED
, this will complete withQualityCode.Bad_Unsupported
.
-
retireNode
Description copied from interface:DataNodeSession
Retires the node, indicating no further data changes are expected. After calling this method, it is expected thatrelease()
will be called subsequently to properly clean up resources.- Specified by:
retireNode
in interfaceDataNodeSession
- Returns:
- A
CompletionStage
that, when completed, provides theQualityCode
of the operation. If the node's availability status isUNSUPPORTED
, this will complete withQualityCode.Bad_Unsupported
. - See Also:
-
release
public void release()Description copied from interface:DataNodeSession
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.- Specified by:
release
in interfaceDataNodeSession
-