Class ConnectorRegistry
- Namespace
- JD.AI.Connectors.Sdk
- Assembly
- JD.AI.Connectors.Sdk.dll
Discovers, registers, and manages IConnector implementations.
public sealed class ConnectorRegistry
- Inheritance
-
ConnectorRegistry
- Inherited Members
Properties
All
All registered connectors.
public IReadOnlyCollection<ConnectorDescriptor> All { get; }
Property Value
Methods
Get(string)
Gets a registered connector by name.
public ConnectorDescriptor? Get(string name)
Parameters
namestring
Returns
Register(IConnector, IServiceCollection)
Registers a connector and runs its Configure(IConnectorBuilder) method.
public ConnectorDescriptor Register(IConnector connector, IServiceCollection services)
Parameters
connectorIConnectorThe connector instance.
servicesIServiceCollectionThe service collection to configure.
Returns
Exceptions
- InvalidOperationException
Thrown if the connector is not decorated with JdAiConnectorAttribute.
ScanAndRegister(IEnumerable<Assembly>, IServiceCollection)
Scans assemblies for types with JdAiConnectorAttribute and registers each found connector using a default (parameterless) constructor.
public void ScanAndRegister(IEnumerable<Assembly> assemblies, IServiceCollection services)
Parameters
assembliesIEnumerable<Assembly>Assemblies to scan.
servicesIServiceCollectionThe service collection.
SetEnabled(string, bool)
Enables or disables a registered connector by name.
public bool SetEnabled(string name, bool enabled)
Parameters
Returns
- bool
trueif the connector was found and updated.