Interface StoreAndForwardManager
public interface StoreAndForwardManager
The main manager interface for handling all store and forward operations.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Optional<EngineInformation>
getEngineInformation
(String engineId) Gets descriptiveEngineInformation
about the specified engine that is registered with this manager.getEngineInformation
(String engineId, boolean includeQuarantinedInfo) Gets descriptiveEngineInformation
about the specified engine that is registered with this manager.getQuarantineInterface
(String engineId) Gets an Optional of theQuarantineInterface
that is associated with an engine if supported.<T extends PersistentData>
List<String>getSupportedEngines
(PersistentFlavor<T> flavor) Gets a list of all engine ids that accept data for the specified flavor.lookupFlavor
(String flavorSignature) Looks up the registered matchingPersistentFlavor
within this manager as determined by the specified flavor signature.<T extends PersistentData>
voidregisterDataFlavor
(PersistentFlavor<T> flavor) Registers a new data flavor with the manager.default <T extends PersistentData>
voidregisterSink
(DataSink<T> sink) Registers aDataSink
with the specified store and forward engine.<T extends PersistentData>
voidregisterSink
(DataSink<T> sink, boolean createEngine) Registers aDataSink
with the specified store and forward engine.<T extends PersistentData>
voidstoreData
(PersistentDataBundle<T> dataBundle) Stores thePersistentDataBundle
against the specified store and forward engine as indicated within the data's storage key.default <T extends PersistentData>
voidstoreData
(StorageKey storageKey, List<T> data) Stores a list of persistent data associated with a specific storage key.default <T extends PersistentData>
voidstoreData
(StorageKey storageKey, T data) Stores the provided persistent data associated with a specific storage key.<T extends PersistentData>
voidunregisterDataFlavor
(PersistentFlavor<T> flavor) Unregisters a data flavor with the manager.<T extends PersistentData>
voidunregisterSink
(DataSink<T> sink) Unregisters aDataSink
from the specified store and forward engine.<T extends PersistentData>
voidunregisterSink
(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.
-
Method Details
-
registerSink
Registers aDataSink
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
Registers aDataSink
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 thecreateEngine
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 registercreateEngine
- if true, creates a new engine if one does not already exist
-
unregisterSink
Unregisters aDataSink
from the specified store and forward engine.- Parameters:
sink
- the sink to unregister
-
unregisterSink
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 sinkflavor
- the persistent flavor associated with the data type managed by the sink
-
registerDataFlavor
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
Unregisters a data flavor with the manager.- Parameters:
flavor
- The persistent flavor to unregister.
-
lookupFlavor
Looks up the registered matchingPersistentFlavor
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
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 implementPersistentData
- Parameters:
storageKey
- the key identifying the storage destination and sinkdata
- 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 implementPersistentData
- Parameters:
storageKey
- the key identifying the storage destination and sinkdata
- the list of persistent data to store- Throws:
Exception
- if an error occurs while storing the data
-
storeData
Stores thePersistentDataBundle
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
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
Gets descriptiveEngineInformation
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
Gets descriptiveEngineInformation
about the specified engine that is registered with this manager. Quarantined data info will only be included if the specific istrue
.- Parameters:
engineId
- the id of the engine to get information forincludeQuarantinedInfo
- ifQuarantinedDataInfo
results should be included- Returns:
- an optional containing the engine information if it exists
-
getQuarantineInterface
Gets an Optional of theQuarantineInterface
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
-