Interface ISinkRegistry
- Namespace
- Datafication.Server.Core.Registry
- Assembly
- Datafication.Server.Core.dll
Defines a registry for managing sink types by key identifiers.
public interface ISinkRegistry
Methods
CreateSink(string, Dictionary<string, object>?)
Creates a sink instance using the registered type.
object? CreateSink(string sinkKey, Dictionary<string, object>? sinkOptions = null)
Parameters
sinkKeystringThe sink key identifier.
sinkOptionsDictionary<string, object>Optional configuration options to apply to the sink.
Returns
- object
The sink instance if found; otherwise, null.
GetContentType(string)
Gets the appropriate HTTP content type for the specified sink.
string GetContentType(string sinkKey)
Parameters
sinkKeystringThe sink key identifier.
Returns
- string
The content type string if determined; otherwise, "application/octet-stream".
GetRegisteredSinkKeys()
Gets all registered sink keys.
IEnumerable<string> GetRegisteredSinkKeys()
Returns
- IEnumerable<string>
A collection of all registered sink keys.
GetSinkReturnType(string)
Gets the return type of the specified sink.
Type? GetSinkReturnType(string sinkKey)
Parameters
sinkKeystringThe sink key identifier.
Returns
- Type
The return type of the sink if found; otherwise, null.
IsSinkRegistered(string)
Checks if a sink with the specified key is registered.
bool IsSinkRegistered(string sinkKey)
Parameters
sinkKeystringThe sink key identifier.
Returns
- bool
True if the sink is registered; otherwise, false.
RegisterSink<TSink>(string)
Registers a sink type for a specific sink key.
void RegisterSink<TSink>(string sinkKey) where TSink : class
Parameters
sinkKeystringThe identifier for the sink type (e.g., "pdf", "excel").
Type Parameters
TSinkThe type of the sink.
TransformAsync(string, DataBlock, Dictionary<string, object>?)
Transforms a DataBlock using the specified sink with optional configuration.
Task<object> TransformAsync(string sinkKey, DataBlock dataBlock, Dictionary<string, object>? sinkOptions = null)
Parameters
sinkKeystringThe sink key identifier.
dataBlockDataBlockThe DataBlock to transform.
sinkOptionsDictionary<string, object>Optional configuration options to apply to the sink.
Returns
- Task<object>
A task representing the asynchronous operation with the transformation result.