Skip to main content

IRuntimeRepositoryProvider

Namespace: Meshmakers.Octo.Runtime.Contracts

Provides access to runtime repositories for specific tenants. This interface allows services to obtain a repository instance for a given tenant ID.

public interface IRuntimeRepositoryProvider

Methods​

GetRepositoryAsync(String, CancellationToken)​

Gets a runtime repository for the specified tenant.

Task<IRuntimeRepository> GetRepositoryAsync(string tenantId, CancellationToken cancellationToken)

Parameters​

tenantId String
The tenant identifier

cancellationToken CancellationToken
Cancellation token

Returns​

Task<IRuntimeRepository>
The runtime repository for the tenant, or null if not available

IsRepositoryAvailable(String)​

Checks if a repository is available for the specified tenant.

bool IsRepositoryAvailable(string tenantId)

Parameters​

tenantId String
The tenant identifier

Returns​

Boolean
True if a repository is available for the tenant

GetSchemaVersionsAsync(String, CancellationToken)​

Gets the CK model versions currently installed in the tenant's schema. This method should be called BEFORE importing new CK models to capture the current versions for migration purposes.

Task<IReadOnlyDictionary<string, string>> GetSchemaVersionsAsync(string tenantId, CancellationToken cancellationToken)

Parameters​

tenantId String
The tenant identifier

cancellationToken CancellationToken
Cancellation token

Returns​

Task<IReadOnlyDictionary<String, String>>
Dictionary mapping model names to their installed version strings

EnsureCkModelInstalledAsync(String, CkModelId, OperationResult, CancellationToken)​

Ensures the specified CK model is installed in the tenant's schema. Idempotent: if the exact model id is already present, this is a no-op apart from running any pending migrations. Otherwise the compiled model is fetched from a catalog and written into the tenant database, and the in-memory CK cache is invalidated so the next access reloads the model graph.

Task EnsureCkModelInstalledAsync(string tenantId, CkModelId modelId, OperationResult operationResult, CancellationToken cancellationToken)

Parameters​

tenantId String
The tenant identifier

modelId CkModelId
The concrete CK model id (name + exact version) to install

operationResult OperationResult
Collects validation messages from catalog lookup and install

cancellationToken CancellationToken
Cancellation token

Returns​

Task