Interface IMailboxExportArchiveStore
- Namespace
- MailFathom.Application.Mail.Export
- Assembly
- MailFathom.Application.dll
Writes an export's archive into the content store as it is produced, serves it back, and removes it.
public interface IMailboxExportArchiveStore
Remarks
A port of its own beside IEmailContentStore, and the one content write in MailFathom that is not byte-based.
ADR 0017 § 4
keeps every mail payload whole in memory because a message arrives whole and its digest is computed over all of it;
an archive is neither — it is produced a message at a time and is as large as a mailbox, which is past what a
bytea column holds and far past what a process should. So the archive alone is written as a stream, and the
rest of the content port is unchanged.
Unlike the mail payload port, this one is registered whatever the deployment selected, because the job handler and the expiry sweep are registered whatever it selected too. IsAvailable is therefore a fact a use case reads rather than a failure it meets: a deployment writing content to its database refuses the export before a job exists, naming the setting that would turn it on.
Nothing here logs a key or any part of an archive. A key names one person's whole mailbox, which makes it the most concentrated identifier this system mints.
Properties
- IsAvailable
Gets whether this deployment has somewhere to keep an archive at all.
Methods
- BeginWriteAsync(MailboxExportId, CancellationToken)
Opens a write the archive is produced into, under a key minted for it.
- DeleteAsync(string, CancellationToken)
Removes one archive, which is what an expiry, a deletion, and a cancellation each carry through to the store.
- OpenReadAsync(string, CancellationToken)
Opens the finished archive for reading, so any replica can serve it.