ICkCacheService
Namespace: Meshmakers.Octo.ConstructionKit.Contracts.Services
Service for managing the cache of compiled construction kit models.
public interface ICkCacheService
Methods
CreateTenant(String)
Create a new tenant cache.
void CreateTenant(string tenantId)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
LoadCkModelGraph(String, ICkModelGraph)
Loads a already analyzed model into a tenant cache.
void LoadCkModelGraph(string tenantId, ICkModelGraph modelGraph)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
modelGraph ICkModelGraph
The ready analyzed graph model
Exceptions
GetCkModelIds(String)
Returns the construction kit model library ids for a tenant.
ICollection<CkModelId> GetCkModelIds(string tenantId)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
Returns
ICollection<CkModelId>
A list of dependencies
EnsureModelIds(String, IEnumerable<CkModelId>)
Ensures that the given model ids are available in the cache.
ICollection<CkModelId> EnsureModelIds(string tenantId, IEnumerable<CkModelId> modelIds)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
modelIds IEnumerable<CkModelId>
The model ids to ensure
Returns
ICollection<CkModelId>
A list of models that are not existing
EnsureModelIdRanges(String, IEnumerable<CkModelIdVersionRange>)
Ensures that the given model id version ranges are satisfied by models available in the cache.
ICollection<CkModelIdVersionRange> EnsureModelIdRanges(string tenantId, IEnumerable<CkModelIdVersionRange> modelIdRanges)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
modelIdRanges IEnumerable<CkModelIdVersionRange>
The model id version ranges to ensure
Returns
ICollection<CkModelIdVersionRange>
A list of version ranges that are not satisfied by any loaded model
Unload(String)
Unload a tenant cache.
void Unload(string tenantId)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
IsTenantLoaded(String)
Returns true if the tenant is loaded
bool IsTenantLoaded(string tenantId)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
Returns
GetCkTypes(String)
Returns all available CkTypeGraph from the cache.
IEnumerable<CkTypeGraph> GetCkTypes(string tenantId)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
Returns
GetCkType(String, CkId<CkTypeId>)
Returns a CkTypeGraph from the cache.
CkTypeGraph GetCkType(string tenantId, CkId<CkTypeId> ckTypeId)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
ckTypeId CkId<CkTypeId>
Construction Kit type id.
Returns
GetRtCkType(String, RtCkId<CkTypeId>)
Returns a CkTypeGraph from the cache.
CkTypeGraph GetRtCkType(string tenantId, RtCkId<CkTypeId> rtCkTypeId)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
rtCkTypeId RtCkId<CkTypeId>
Construction Kit type id.
Returns
TryGetCkType(String, CkId<CkTypeId>, out CkTypeGraph)
Returns a CkTypeGraph from the cache.
bool TryGetCkType(string tenantId, CkId<CkTypeId> ckTypeId, out CkTypeGraph ckTypeGraph)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
ckTypeId CkId<CkTypeId>
Construction Kit type id.
ckTypeGraph CkTypeGraph
Returns the ck type graph
Returns
Boolean
True, when the given ck type id exists
Exceptions
TryGetRtCkType(String, RtCkId<CkTypeId>, out CkTypeGraph)
Returns a CkTypeGraph from the cache.
bool TryGetRtCkType(string tenantId, RtCkId<CkTypeId> rtCkTypeId, out CkTypeGraph ckTypeGraph)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
rtCkTypeId RtCkId<CkTypeId>
Construction Kit type id.
ckTypeGraph CkTypeGraph
Returns the ck type graph
Returns
Boolean
True, when the given ck type id exists
Exceptions
GetCkRecords(String)
Returns all available CkRecordGraph from the cache.
IEnumerable<CkRecordGraph> GetCkRecords(string tenantId)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
Returns
TryGetCkRecord(String, CkId<CkRecordId>, out CkRecordGraph)
Returns a CkRecordGraph from the cache.
bool TryGetCkRecord(string tenantId, CkId<CkRecordId> ckRecordId, out CkRecordGraph ckRecordGraph)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
ckRecordId CkId<CkRecordId>
Construction Kit record id.
ckRecordGraph CkRecordGraph
Returns the ck record graph
Returns
Boolean
True, when the given ck record id exists
Exceptions
TryGetRtCkRecord(String, RtCkId<CkRecordId>, out CkRecordGraph)
Returns a CkRecordGraph from the cache.
bool TryGetRtCkRecord(string tenantId, RtCkId<CkRecordId> rtCkRecordId, out CkRecordGraph ckRecordGraph)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
rtCkRecordId RtCkId<CkRecordId>
Construction Kit record id.
ckRecordGraph CkRecordGraph
Returns the ck record graph
Returns
Boolean
True, when the given ck record id exists
Exceptions
TryGetCkEnum(String, CkId<CkEnumId>, out CkEnumGraph)
Returns a CkEnumGraph from the cache.
bool TryGetCkEnum(string tenantId, CkId<CkEnumId> ckEnumId, out CkEnumGraph ckEnumGraph)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
ckEnumId CkId<CkEnumId>
Construction Kit enum id.
ckEnumGraph CkEnumGraph
Returns the ck enum graph
Returns
Boolean
True, when the given ck enum id exists
Exceptions
TryGetRtCkEnum(String, RtCkId<CkEnumId>, out CkEnumGraph)
Returns a CkEnumGraph from the cache.
bool TryGetRtCkEnum(string tenantId, RtCkId<CkEnumId> rtCkEnumId, out CkEnumGraph ckEnumGraph)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
rtCkEnumId RtCkId<CkEnumId>
Construction Kit enum id.
ckEnumGraph CkEnumGraph
Returns the ck enum graph
Returns
Boolean
True, when the given ck enum id exists
Exceptions
GetCkAttribute(String, CkId<CkAttributeId>)
Returns a CkAttributeGraph from the cache.
CkAttributeGraph GetCkAttribute(string tenantId, CkId<CkAttributeId> ckAttributeId)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
ckAttributeId CkId<CkAttributeId>
Construction Kit attribute id.
Returns
GetRtCkAttribute(String, RtCkId<CkAttributeId>)
Returns a CkAttributeGraph from the cache.
CkAttributeGraph GetRtCkAttribute(string tenantId, RtCkId<CkAttributeId> rtCkAttributeId)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
rtCkAttributeId RtCkId<CkAttributeId>
Construction Kit attribute id.
Returns
GetCkAssociationRole(String, CkId<CkAssociationRoleId>)
Returns a CkAssociationRoleGraph from the cache.
CkAssociationRoleGraph GetCkAssociationRole(string tenantId, CkId<CkAssociationRoleId> ckAssociationRoleId)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
ckAssociationRoleId CkId<CkAssociationRoleId>
Construction Kit attribute id.
Returns
Exceptions
GetRtCkAssociationRole(String, RtCkId<CkAssociationRoleId>)
Returns a CkAssociationRoleGraph from the cache.
CkAssociationRoleGraph GetRtCkAssociationRole(string tenantId, RtCkId<CkAssociationRoleId> rtCkAssociationRoleId)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
rtCkAssociationRoleId RtCkId<CkAssociationRoleId>
Construction Kit attribute id.
Returns
Exceptions
GetCkRecord(String, CkId<CkRecordId>)
Returns a CkRecordGraph from the cache.
CkRecordGraph GetCkRecord(string tenantId, CkId<CkRecordId> ckRecordId)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
ckRecordId CkId<CkRecordId>
Construction Kit record id.
Returns
Exceptions
GetRtCkRecord(String, RtCkId<CkRecordId>)
Returns a CkRecordGraph from the cache.
CkRecordGraph GetRtCkRecord(string tenantId, RtCkId<CkRecordId> rtCkRecordId)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
rtCkRecordId RtCkId<CkRecordId>
Construction Kit record id.
Returns
Exceptions
GetCkEnums(String)
Returns all available CkEnumGraph from the cache.
IEnumerable<CkEnumGraph> GetCkEnums(string tenantId)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
Returns
GetCkEnum(String, CkId<CkEnumId>)
Returns a CkRecordGraph from the cache.
CkEnumGraph GetCkEnum(string tenantId, CkId<CkEnumId> ckEnumId)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
ckEnumId CkId<CkEnumId>
Construction Kit record id.
Returns
Exceptions
GetRtCkEnum(String, RtCkId<CkEnumId>)
Returns a CkRecordGraph from the cache.
CkEnumGraph GetRtCkEnum(string tenantId, RtCkId<CkEnumId> rtCkEnumId)
Parameters
tenantId String
Unique name of the tenant within Octo Instance.
rtCkEnumId RtCkId<CkEnumId>
Construction Kit record id.
Returns
Exceptions
SaveCacheAsync(String, Stream)
Saves the cache to a stream.
Task SaveCacheAsync(string tenantId, Stream stream)
Parameters
tenantId String
Unique name of the tenant within Octo Instance
stream Stream
Stream ready for write
Returns
Exceptions
RestoreCacheAsync(String, Stream)
Restores the cache from a stream.
Task RestoreCacheAsync(string tenantId, Stream stream)
Parameters
tenantId String
Unique name of the tenant within Octo Instance
stream Stream
Stream ready for read
Returns
Exceptions
RestoreCache(String, String)
Restores the cache from a stream.
void RestoreCache(string tenantId, string jsonText)
Parameters
tenantId String
Unique name of the tenant within Octo Instance
jsonText String
JSON formatted cache representation
Exceptions
GetCkTypeQueryColumnPathsByRtCkId(String, RtCkId<CkTypeId>, CkTypeQueryColumnOptions)
Returns the construction kit model library ids for a tenant.
IReadOnlyCollection<CkTypeQueryColumn> GetCkTypeQueryColumnPathsByRtCkId(string tenantId, RtCkId<CkTypeId> rtCkTypeId, CkTypeQueryColumnOptions options)
Parameters
tenantId String
Unique name of the tenant within Octo Instance
rtCkTypeId RtCkId<CkTypeId>
The construction kit type id
options CkTypeQueryColumnOptions
Options for the query column path retrieval
Returns
IReadOnlyCollection<CkTypeQueryColumn>
GetCkTypeQueryColumnPaths(String, CkId<CkTypeId>, CkTypeQueryColumnOptions)
Returns the construction kit model library ids for a tenant.
IReadOnlyCollection<CkTypeQueryColumn> GetCkTypeQueryColumnPaths(string tenantId, CkId<CkTypeId> ckTypeId, CkTypeQueryColumnOptions options)
Parameters
tenantId String
Unique name of the tenant within Octo Instance
ckTypeId CkId<CkTypeId>
The construction kit type id
options CkTypeQueryColumnOptions
Options for the query column path retrieval