Method AssessAsync
- Namespace
- MailFathom.Application.Mail.Maintenance
- Assembly
- MailFathom.Application.dll
AssessAsync(StoredMailScope, CancellationToken)
Reports how much mail a rewind of one scope would have the next runs read again.
public Task<int> AssessAsync(StoredMailScope scope, CancellationToken cancellationToken)
Parameters
scopeStoredMailScopeThe account, and the one folder of it, the rewind would cover.
cancellationTokenCancellationTokenCancels the read.
Returns
Remarks
It is what the scope holds rather than what a run would fetch, and the two differ: mail the server no longer holds is not fetched again, and mail that arrived since is fetched without ever having been stored. Neither difference is knowable without a mailbox session, which this deliberately does not open, and the stored count is the figure of the right order for the decision an operator is making.
It counts rather than discards, so it asks for the permission a report of the deployment's own state is published under and never for the one that performs the rewind.
Exceptions
- ArgumentNullException
Thrown when
scopeis null.- PrincipalNotAuthorizedException
Thrown when the use case was reached by anything but a caller granted AdminRead.