Table of Contents

Interface IConnectorRegistry

Namespace
Datafication.Server.Core.Registry
Assembly
Datafication.Server.Core.dll

Defines a registry for managing connector factories by type identifiers.

public interface IConnectorRegistry

Methods

CreateConnector(string, IDataConnectorConfiguration)

Creates a data connector using the registered factory.

IDataConnector CreateConnector(string connectorType, IDataConnectorConfiguration configuration)

Parameters

connectorType string

The connector type identifier.

configuration IDataConnectorConfiguration

The connector configuration.

Returns

IDataConnector

The data connector instance.

CreateConnectorFromOptions(string, string, Dictionary<string, object>?)

Creates a data connector using the registered factory with configuration from options.

IDataConnector CreateConnectorFromOptions(string connectorType, string id, Dictionary<string, object>? options = null)

Parameters

connectorType string

The connector type identifier.

id string

The unique identifier for the connector.

options Dictionary<string, object>

The connector configuration options as key-value pairs.

Returns

IDataConnector

The data connector instance.

GetConnectorFactory(string)

Gets a connector factory for the specified connector type.

IDataConnectorFactory? GetConnectorFactory(string connectorType)

Parameters

connectorType string

The connector type identifier.

Returns

IDataConnectorFactory

The connector factory instance if found; otherwise, null.

GetRegisteredConnectorTypes()

Gets all registered connector type identifiers.

IEnumerable<string> GetRegisteredConnectorTypes()

Returns

IEnumerable<string>

A collection of connector type identifiers.

IsConnectorRegistered(string)

Checks if a connector type is registered.

bool IsConnectorRegistered(string connectorType)

Parameters

connectorType string

The connector type identifier to check.

Returns

bool

True if the connector type is registered; otherwise, false.

RegisterConnector<TFactory, TConfiguration>(string)

Registers a connector factory for a specific connector type.

void RegisterConnector<TFactory, TConfiguration>(string connectorType) where TFactory : class, IDataConnectorFactory where TConfiguration : class

Parameters

connectorType string

The identifier for the connector type (e.g., "csv", "excel").

Type Parameters

TFactory

The type of the connector factory.

TConfiguration

The type of the connector configuration.