Interface Historian<S extends HistorianSettings>
- Type Parameters:
S- The type parameter that extendsHistorianSettings, representing the specific settings of the historian.
- All Known Subinterfaces:
TagHistoryProvider<S>
- All Known Implementing Classes:
AbstractHistorian,CoreHistorian,CsvHistorian,HistorySplitterProvider,InternalHistorian,RemoteHistorianProvider,SimulatorHistorian,WideDbHistoryProvider
public interface Historian<S extends HistorianSettings>
Defines the contract for a historian, which manages the storage, query, and lifecycle of historical data.
A historian is responsible for handling historical data operations, including adapting paths,
processing queries, and managing storage engines.
This interface provides core functionalities that can be implemented or extended for custom historian behaviors.
-
Method Summary
Modifier and TypeMethodDescriptiongetName()Retrieves the name of the historian.default QualifiedPathAdapterRetrieves theQualifiedPathAdapterinstance used for normalizingQualifiedPathobjects.default Optional<QueryEngine>Retrieves the interface for querying historical data.Retrieves the settings associated with the historian.Retrieves the current status of the historian.default Optional<StorageEngine>Retrieves the interface for managing historical data storage.default booleanhandleNameChange(String newName) Handles a change in the historian's name and determines if the change can be dynamically applied without requiring a complete restart or replacement of the historian.default booleanhandleSettingsChange(S newSettings) Handles a change in the historian's settings and determines if the change can be dynamically applied without requiring a complete restart or replacement of the historian.voidshutdown()Shuts down the historian and any associated resources.voidstartup()Starts the historian and initializes any necessary resources required for its operation.
-
Method Details
-
startup
Starts the historian and initializes any necessary resources required for its operation. This method is responsible for setting up the internal state of the historian and preparing it to handle incoming requests or data processing.Implementations may include the following operations: - Allocating and initializing required resources. - Establishing connections to external systems or storage backends. - Setting up any internal scheduling or maintenance tasks.
If this method is invoked when the historian is already started, an
IllegalStateExceptionmay be thrown to prevent duplicate initialization.- Throws:
Exception- if an error occurs during the startup process.
-
shutdown
void shutdown()Shuts down the historian and any associated resources. This method is responsible for ensuring that the historian ceases operations cleanly and releases any allocated resources. Once invoked, the historian should no longer accept or process new requests.Implementations may include tasks such as: - Stopping active data processing tasks. - Freeing up connections to external systems or storage. - Logging a shutdown message for diagnostic or auditing purposes.
If this method is overridden in a subclass, it is recommended to call the superclass implementation to ensure proper cleanup behavior.
-
getName
String getName()Retrieves the name of the historian.- Returns:
- the name of the historian as a
String
-
getSettings
S getSettings()Retrieves the settings associated with the historian. The returned settings provide configuration details specific to the historian's operation.- Returns:
- an instance of
Srepresenting the settings of the historian
-
getStatus
ProfileStatus getStatus()Retrieves the current status of the historian.- Returns:
- the current
ProfileStatus, indicating the general state and optional message describing the historian's operational state.
-
getQueryEngine
Retrieves the interface for querying historical data. By default, this method returns an emptyOptional, indicating that noQueryEngineis provided.- Returns:
- An
Optionalcontaining theQueryEngineinstance, or an emptyOptionalif none is available.
-
getStorageEngine
Retrieves the interface for managing historical data storage. By default, this method returns an emptyOptional, indicating that noStorageEngineis provided.- Returns:
- An
Optionalcontaining theStorageEngineinstance, or an emptyOptionalif none is available.
-
getPathAdapter
Retrieves theQualifiedPathAdapterinstance used for normalizingQualifiedPathobjects. By default, this method returns theQualifiedPathAdapter.DEFAULT.- Returns:
- the
QualifiedPathAdapterinstance used for path normalization
-
handleNameChange
Handles a change in the historian's name and determines if the change can be dynamically applied without requiring a complete restart or replacement of the historian.- Parameters:
newName- The new name to be applied to the historian.- Returns:
trueif the historian successfully applied the name change dynamically.falseif the historian doesn't support applying the name dynamically and requires a new instance with the updated name or a restart.
-
handleSettingsChange
Handles a change in the historian's settings and determines if the change can be dynamically applied without requiring a complete restart or replacement of the historian.- Parameters:
newSettings- The new settings to be applied to the historian. This parameter represents an instance of the historian's settings class.- Returns:
trueif the historian successfully applied the settings change dynamically.falseif the historian doesn't support applying the settings dynamically and requires a new instance with the updated settings or a restart.
-