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(StorageId identifier, PersistentFlavor<T> flavor)
      Unregisters a DataSink, belonging to the specified PersistentFlavor, from the specified store and forward system.
      Parameters:
      identifier - the identifier associated with the data sink
      flavor - the flavor belonging to the desired (unregistered) sink's supported flavor
    • 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(StorageId identifier, T data) throws Exception
      Stores single PersistentData to the store and forward engine.
      Parameters:
      identifier - the identifier to be used for determining where to store the data
      data - the data to store
      Throws:
      Exception - if an error occurs while storing the data
    • storeData

      default <T extends PersistentData> void storeData(StorageId identifier, List<T> data) throws Exception
      Stores list of PersistentData to the specified store and forward engine.
      Parameters:
      identifier - the identifier to be used for determining where to store the data
      data - the list of 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 id.
      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