Interface StoreAndForwardManager


public interface StoreAndForwardManager
The main manager interface for handling all store and forward operations.
  • Method Details

    • registerSink

      default <T extends PersistentData> void registerSink(DataSink<T> sink)
      Registers a DataSink with the specified store and forward engine. A standard engine will be created if one doesn't already exist.
      Parameters:
      sink - the sink to register
    • registerSink

      <T extends PersistentData> void registerSink(DataSink<T> sink, boolean createEngine)
      Registers a DataSink with the specified store and forward engine.

      Depending on the implementation, a sink can be temporarily cached within the manager if the engine doesn't exist and the createEngine flag is false. This allows for the sink to be registered with the engine at a later time once it's created.
      Parameters:
      sink - the sink to register
      createEngine - if true, creates a new engine if one does not already exist
    • unregisterSink

      <T extends PersistentData> void unregisterSink(DataSink<T> sink)
      Unregisters a DataSink from the specified store and forward engine.
      Parameters:
      sink - the sink to unregister
    • unregisterSink

      <T extends PersistentData> void unregisterSink(StorageKey storageKey, PersistentFlavor<T> flavor)
      Unregisters a data sink from the specified store-and-forward engine using the given storage key and associated persistent flavor. This method effectively removes the association of the sink with the engine, disabling further data persistence using the specified sink configuration.
      Type Parameters:
      T - the type of persistent data associated with the flavor and sink
      Parameters:
      storageKey - the key identifying the storage destination and the specific data sink
      flavor - the persistent flavor associated with the data type managed by the sink
    • registerDataFlavor

      <T extends PersistentData> void registerDataFlavor(PersistentFlavor<T> flavor)
      Registers a new data flavor with the manager. This can allow for future lookups when attempting to deserialize data when only the flavor key is known.
      Parameters:
      flavor - The persistent flavor to register.
    • unregisterDataFlavor

      <T extends PersistentData> void unregisterDataFlavor(PersistentFlavor<T> flavor)
      Unregisters a data flavor with the manager.
      Parameters:
      flavor - The persistent flavor to unregister.
    • lookupFlavor

      Optional<PersistentFlavor<?>> lookupFlavor(String flavorSignature)
      Looks up the registered matching PersistentFlavor within this manager as determined by the specified flavor signature.
      Parameters:
      flavorSignature - the flavor signature to use for the lookup
      Returns:
      An optional PersistentFlavor, or empty if no flavor was found.
    • storeData

      default <T extends PersistentData> void storeData(StorageKey storageKey, T data) throws Exception
      Stores the provided persistent data associated with a specific storage key. This is used to persist data into a store-and-forward system.
      Type Parameters:
      T - the type of data to store, which must implement PersistentData
      Parameters:
      storageKey - the key identifying the storage destination and sink
      data - the persistent data to store
      Throws:
      Exception - if an error occurs while storing the data
    • storeData

      default <T extends PersistentData> void storeData(StorageKey storageKey, List<T> data) throws Exception
      Stores a list of persistent data associated with a specific storage key. This is used to persist multiple data elements into a store-and-forward system.
      Type Parameters:
      T - the type of data to store, which must implement PersistentData
      Parameters:
      storageKey - the key identifying the storage destination and sink
      data - the list of persistent data to store
      Throws:
      Exception - if an error occurs while storing the data
    • storeData

      <T extends PersistentData> void storeData(PersistentDataBundle<T> dataBundle) throws Exception
      Stores the PersistentDataBundle against the specified store and forward engine as indicated within the data's storage key.
      Parameters:
      dataBundle - the data to store against the desired store and forward engine
      Throws:
      Exception - if an error occurs while storing the data
    • getSupportedEngines

      <T extends PersistentData> List<String> getSupportedEngines(@Nullable PersistentFlavor<T> flavor)
      Gets a list of all engine ids that accept data for the specified flavor. If the flavor is null, then all ids for registered engines will be returned.
      Parameters:
      flavor - the flavor to search for, nullable
      Returns:
      a list of all engines can accept data for the specified flavor
    • getEngineInformation

      default Optional<EngineInformation> getEngineInformation(String engineId)
      Gets descriptive EngineInformation about the specified engine that is registered with this manager. If the engine supports quarantining data, then quarantined info will be included with the engine info.
      Parameters:
      engineId - the id of the engine to get information for
      Returns:
      an optional containing the engine information if it exists
    • getEngineInformation

      Optional<EngineInformation> getEngineInformation(String engineId, boolean includeQuarantinedInfo)
      Gets descriptive EngineInformation about the specified engine that is registered with this manager. Quarantined data info will only be included if the specific is true.
      Parameters:
      engineId - the id of the engine to get information for
      includeQuarantinedInfo - if QuarantinedDataInfo results should be included
      Returns:
      an optional containing the engine information if it exists
    • getQuarantineInterface

      Optional<QuarantineInterface<?>> getQuarantineInterface(String engineId)
      Gets an Optional of the QuarantineInterface that is associated with an engine if supported. An empty Optional will be returned if the interface doesn't exist, or unsupported by the engine.
      Parameters:
      engineId - the engine id that supports quarantining capability
      Returns:
      an optional containing the QuarantineInterface if it exists