Class AbstractHistorian<S extends HistorianSettings>

java.lang.Object
com.inductiveautomation.historian.gateway.api.AbstractHistorian<S>
All Implemented Interfaces:
Historian<S>
Direct Known Subclasses:
CoreHistorian, CsvHistorian, InternalHistorian

public abstract class AbstractHistorian<S extends HistorianSettings> extends Object implements Historian<S>
Abstract base class for historian implementations. This class provides foundational behavior that can be extended by specific historian types.

The AbstractHistorian class manages core components such as logging, gateway context, and path adaptation, and provides mechanisms to start and stop historian operations. It also includes utility methods for path normalization and transformation, which subclasses can leverage for processing historical data paths.

Responsibilities include: - Managing the lifecycle of the historian (startup and shutdown). - Logging related to the historian's operations. - Providing access to a QualifiedPathAdapter for path normalization. - Utility methods for working with paths, including transformation and reversal.

Subclasses are expected to provide additional capability and implementations specific to their needs, possibly overriding some of the base behaviors.

  • Field Details

    • logger

      protected final LoggerEx logger
    • context

      protected final GatewayContext context
    • historianName

      protected String historianName
    • historianSettings

      protected S extends HistorianSettings historianSettings
    • started

      protected boolean started
  • Constructor Details

  • Method Details

    • getPathAdapter

      public QualifiedPathAdapter getPathAdapter()
      Description copied from interface: Historian
      Retrieves the QualifiedPathAdapter instance used for normalizing QualifiedPath objects. By default, this method returns the QualifiedPathAdapter.DEFAULT.
      Specified by:
      getPathAdapter in interface Historian<S extends HistorianSettings>
      Returns:
      the QualifiedPathAdapter instance used for path normalization
    • getName

      public String getName()
      Description copied from interface: Historian
      Retrieves the name of the historian.
      Specified by:
      getName in interface Historian<S extends HistorianSettings>
      Returns:
      the name of the historian as a String
    • getSettings

      public S getSettings()
      Description copied from interface: Historian
      Retrieves the settings associated with the historian. The returned settings provide configuration details specific to the historian's operation.
      Specified by:
      getSettings in interface Historian<S extends HistorianSettings>
      Returns:
      an instance of S representing the settings of the historian
    • startup

      public final void startup() throws Exception
      Description copied from interface: Historian
      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 IllegalStateException may be thrown to prevent duplicate initialization.

      Specified by:
      startup in interface Historian<S extends HistorianSettings>
      Throws:
      Exception - if an error occurs during the startup process.
    • onStartup

      protected void onStartup() throws Exception
      Throws:
      Exception
    • shutdown

      public final void shutdown()
      Description copied from interface: Historian
      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.

      Specified by:
      shutdown in interface Historian<S extends HistorianSettings>
    • onShutdown

      protected void onShutdown()
    • transformPath

      protected QualifiedPath transformPath(QualifiedPath path)
    • reversePath

      protected QualifiedPath reversePath(QualifiedPath path)