Interface HistoryManager


public interface HistoryManager
This is the system that handles the store and forward system, allowing historical data to be stored in a reliable way. Each store and forward pipeline has a set of "sinks". Sinks can handle certain types of data, indicated by the HistoryFlavor. A given store and forward pipeline can only have 1 sink for each history flavor. In other parts of the system, the compatible sinks can be retrieved by calling getStores(...) for the specific data flavor to be stored.

There are two types of pipelines in this system: those managed by the system, and those created programmatically by modules. Modules can register sinks using the registerSink function, which will create a pipeline if it doesn't already exist.
  • Method Details

    • registerSink

      void registerSink(DataSink sink)
      Sets up a custom history sink. A standard store and forward pipeline will be created if it does not already exist, unless the sink registered also implements the StoreAndForwardEngine interface. The pipeline that this sink belongs to is defined by DataSink.getPipelineName()
    • registerSinkInPipline

      void registerSinkInPipline(DataSink sink)
      Similar to registerSink, except that it will not create a new store and forward pipeline if the name doesn't exist. Instead, it will hold the sink until the store and forward engine is created or registered. This is often used to add sinks to datasource pipelines, where the pipeline may not be created yet, due to system startup order. Sinks registered in this way will be removed by the normal unregisterSink() function.
    • unregisterSink

      void unregisterSink(DataSink sink, boolean allowDataDeletion)
      Removes the given sink from the specified pipeline. If allowDataDeletion is true, any cached data for the sink will be deleted.
    • storeHistory

      void storeHistory(String dataStore, HistoricalData values) throws IllegalArgumentException, Exception
      Stores the data to the given history store. Will throw an exception if the datastore cannot except the type of data passed in.

      If the gateway is part of a clustered pair, data will only be stored when node is active. Otherwise it will be silently discarded.

      If the store doesn't exist, IllegalArgumentException will be thrown.

      Throws:
      IllegalArgumentException
      Exception
    • canAccept

      boolean canAccept(String dataStore, HistoryFlavor flavor)
      Returns true if the data store will accept the type of data. This returns false if the store does not understand the data, or is not licensed to accept it. Important: It also returns false if this is a redundant node and redundancy is not currently active.
    • getStores

      @Nonnull List<String> getStores(HistoryFlavor historyType)
      Returns a list of data stores that can accept the specified type of data. If historyType is NULL, will return all registered data stores.
    • getStatusInfo

      List<DataSinkInformation> getStatusInfo(String dataStore)
      Returns the hierarchy of status information for the given store, flattened into a list.
      Throws:
      IllegalArgumentException - if the given dataStore name doesn't exist.
    • getQuarantinedDataInfo

      @Nonnull List<QuarantinedDataInfo> getQuarantinedDataInfo(String dataStore)
      Returns information describing the data quarantined in the given store.
    • unquarantineData

      void unquarantineData(@Nullable String dataStore, @Nonnull List<Long> quarantinedDataIds)
      Unquaratines the given QuarantinedDataInfo ids, which will cause the data to enter the forward cycle again.
    • deleteQuarantinedData

      void deleteQuarantinedData(String dataStore, List<Long> quarantinedDataIds)
      Deletes the quarantined data associated with the QuarantinedDataInfo id.
    • exportQuarantinedToXML

      void exportQuarantinedToXML(String dataStore, List<Long> quarantinedDataIds, Writer writer) throws IOException
      Throws:
      IOException
    • importQuarantinedFromXML

      void importQuarantinedFromXML(String dataStore, InputStream is) throws IOException
      Throws:
      IOException
    • registerHistoryFlavor

      void registerHistoryFlavor(HistoryFlavor flavor)
      Registers a history flavor with the system. Only necessary in order to support importing of historical data from the store and forward system.
    • unregisterHistoryFlavor

      void unregisterHistoryFlavor(HistoryFlavor flavor)