IArchiveRuntimeStore
Namespace: Meshmakers.Octo.Runtime.Contracts.StreamData
Abstracts the persistence operations on CkArchive entities required by
IArchiveLifecycleService. Decouples the lifecycle state machine from any
particular runtime repository implementation (Mongo today, possibly others later) and from the
generated CkArchive class itself, so the service stays in Runtime.Engine without
taking a hard dependency on the StreamData CK model package.
public interface IArchiveRuntimeStore
Methods
GetAsync(OctoObjectId)
Reads the current state of the archive identified by , or
null if no such entity exists (or has been soft-deleted).
Task<ArchiveSnapshot> GetAsync(OctoObjectId archiveRtId)
Parameters
archiveRtId OctoObjectId
Returns
SetStatusAsync(OctoObjectId, CkArchiveStatus)
Writes a new CkArchiveStatus on the archive entity. Implementations are responsible for any validation hooks (concept §10) and for emitting the corresponding status-transition event (§14) only if the lifecycle service hasn't already done so via IArchiveAuditTrail.
Task SetStatusAsync(OctoObjectId archiveRtId, CkArchiveStatus newStatus)
Parameters
archiveRtId OctoObjectId
newStatus CkArchiveStatus
Returns
ArchiveEntityAsync(OctoObjectId)
Soft-deletes the archive entity by setting rtState = Archived. The Crate table is
dropped separately by the lifecycle service via IStreamDataRepository.
Task ArchiveEntityAsync(OctoObjectId archiveRtId)
Parameters
archiveRtId OctoObjectId
Returns
EnumerateAsync()
Enumerates every non-soft-deleted CkArchive entity in the tenant. Used by the startup reconciliation job (concept §11) to compare Mongo state against CrateDB reality. Order is implementation-defined; callers must not rely on it.
IAsyncEnumerable<ArchiveSnapshot> EnumerateAsync()