ICatalog
Namespace: Meshmakers.Octo.ConstructionKit.Contracts.ModelCatalogs
Interface for a CK model catalog
public interface ICatalog
Properties
Order
Returns the order of the catalog that will be used to resolve construction kit models. The lower the order, the higher the priority.
public abstract int Order { get; }
Property Value
CatalogName
Returns the name of the catalog, used for identification. catalog names must be unique.
public abstract string CatalogName { get; }
Property Value
Description
Returns the description of the catalog, used for outputs including configuration information.
public abstract string Description { get; }
Property Value
CanWrite
Returns true if the catalog can be used to publish or update models, otherwise false.
public abstract bool CanWrite { get; }
Property Value
CanRead
Returns true if the catalog can be used to read models, otherwise false.
public abstract bool CanRead { get; }
Property Value
Methods
RefreshCatalogAsync(Object, Boolean)
Refreshes the catalog of the catalog, e.g., by reloading from disk or fetching from a remote source.
Task RefreshCatalogAsync(object sourceIdentifier, bool forceRefresh)
Parameters
sourceIdentifier Object
An object, which describes the source which the catalog should search,
set it to null to use default
forceRefresh Boolean
When true, the refresh bypasses the cache freshness window and always
contacts the source
Returns
IsSupportingSourceIdentifier(Object)
Returns true, if the defined source identifier ist supported by the catalog.
bool IsSupportingSourceIdentifier(object sourceIdentifier)
Parameters
sourceIdentifier Object
An object, which describes the source which the catalog should search,
set it to null to use default
Returns
IsExistingAsync(CkModelIdVersionRange, Object)
Checks if a model exists in this catalog
Task<ModelExistingResult> IsExistingAsync(CkModelIdVersionRange modelIdVersionRange, object sourceIdentifier)
Parameters
modelIdVersionRange CkModelIdVersionRange
The construction kit model id with version range
sourceIdentifier Object
An object, which describes the source which the catalog should search,
set it to null to use default
Returns
Task<ModelExistingResult>
A result indicating if the model exists and if yes, which version
IsExistingAsync(CkModelId, Object)
Checks if a model exists in this catalog
Task<bool> IsExistingAsync(CkModelId modelId, object sourceIdentifier)
Parameters
modelId CkModelId
The construction kit model id
sourceIdentifier Object
An object, which describes the source which the catalog should search,
set it to null to use default
Returns
Task<Boolean>
True if the model exists in this catalog, otherwise false
GetAsync(CkModelId, OperationResult, Object, Nullable<CancellationToken>)
Gets a model by its id
Task<CkCompiledModelRoot> GetAsync(CkModelId modelId, OperationResult operationResult, object sourceIdentifier, Nullable<CancellationToken> cancellationToken)
Parameters
modelId CkModelId
The construction kit model id
operationResult OperationResult
Operation results that contain validation messages occured during deserialization.
sourceIdentifier Object
An object, which describes the source which the catalog should search,
set it to null to use default
cancellationToken Nullable<CancellationToken>
A cancellation token that can be used to cancel the operation
Returns
Task<CkCompiledModelRoot>
The deserialized and schema validated construction kit model
PublishAsync(CkCompiledModelRoot, Boolean, Object, Nullable<CancellationToken>)
Publishes a model to the catalog
Task PublishAsync(CkCompiledModelRoot ckCompiledModel, bool force, object sourceIdentifier, Nullable<CancellationToken> cancellationToken)
Parameters
ckCompiledModel CkCompiledModelRoot
The validated construction kit model
force Boolean
Forces the operation by replacing model files if they exist.
sourceIdentifier Object
An object, which describes the source which the catalog should search,
set it to null to use default
cancellationToken Nullable<CancellationToken>
A cancellation token that can be used to cancel the operation
Returns
ListAsync(Object)
Lists all CK models in the catalog for the defined source identifier.
IAsyncEnumerable<CatalogResultItem> ListAsync(object sourceIdentifier)
Parameters
sourceIdentifier Object
An object, which describes the source which the catalog should search,
set it to null to use default
Returns
IAsyncEnumerable<CatalogResultItem>
List of CK models that are available in the catalog
SearchAsync(String, Object)
Searches for CK models in the catalog for the defined source identifier and search term.
IAsyncEnumerable<CatalogResultItem> SearchAsync(string searchTerm, object sourceIdentifier)
Parameters
searchTerm String
Search term to search for in the CK models
sourceIdentifier Object
An object, which describes the source which the catalog should search,
set it to null to use default
Returns
IAsyncEnumerable<CatalogResultItem>
List of CK models that match the search term