Table of Contents

Class ConnectorRegistry

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

Implementation of IConnectorRegistry that manages connector factories with dependency injection support.

public class ConnectorRegistry : IConnectorRegistry
Inheritance
object
ConnectorRegistry
Implements

Constructors

ConnectorRegistry(IServiceProvider)

Initializes a new instance of the ConnectorRegistry class.

public ConnectorRegistry(IServiceProvider serviceProvider)

Parameters

serviceProvider IServiceProvider

The service provider for dependency injection.

Methods

CreateConnector(string, IDataConnectorConfiguration)

Creates a data connector using the registered factory.

public 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.

public 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.

public 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.

public IEnumerable<string> GetRegisteredConnectorTypes()

Returns

IEnumerable<string>

A collection of connector type identifiers.

IsConnectorRegistered(string)

Checks if a connector type is registered.

public 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.

public 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.