Interface IMailboxExportStore
- Namespace
- MailFathom.Application.Mail.Export
- Assembly
- MailFathom.Application.dll
Keeps the record of every export a deployment has been asked for, which is what outlives the job that writes one.
public interface IMailboxExportStore
Remarks
The record rather than the work. A job is claimed, leased, retried, and forgotten; an archive is downloadable for as long as its retention allows and has to be findable by an operator who holds nothing but its identity, so where the export stands is written here and nowhere else.
Every write states the state it expects to find, so two replicas cannot both decide what became of one export: a cancellation that meets a completion leaves the completion, and a completion that meets a cancellation writes nothing and lets the writing job delete what it produced.
Methods
- FindAsync(MailAccountId, MailboxExportId, CancellationToken)
Reads one export of one account.
- FindDueForExpiryAsync(DateTimeOffset, int, CancellationToken)
Names the completed exports whose retention period has run out.
- FindInFlightAsync(MailAccountId, CancellationToken)
Reads the export this account already has being written, where it has one.
- ListAsync(MailAccountId, int, CancellationToken)
Reads the account's exports, newest first.
- RecordAsync(MailboxExport, CancellationToken)
Writes down an export nothing has started yet.
- SaveAsync(MailboxExport, MailboxExportState, CancellationToken)
Writes the export back, but only while it is still in the state the caller decided from.
- SaveProgressAsync(MailboxExportId, long, long, CancellationToken)
Records how far the archive has got, without deciding anything about the export's state.