Table of Contents

Interface IRetentionContributor

Namespace
Excalibur.Compliance
Assembly
Excalibur.Compliance.Abstractions.dll

Store-specific contributor that performs the actual deletion of personal data that has exceeded its retention period. The framework's IRetentionEnforcementService supplies the retention policies the host has declared in scope (from RetentionDays on the declared types) and orchestrates the registered contributors; each contributor knows how to delete expired records from its own store.

public interface IRetentionContributor

Remarks

This mirrors the erasure-side IErasureContributor seam: enforcement is policy-driven by the framework, but the data-store integration is supplied by the consumer. Register one or more contributors in DI so retention enforcement actually deletes data instead of being a no-op.

When no contributor is registered, IRetentionEnforcementService logs a warning and reports zero records cleaned — it never reports success while deleting nothing.

Properties

ConsumesDeclaredPolicies

Gets a value indicating whether this contributor decides what to delete from the DECLARED retention policies in Policies.

bool ConsumesDeclaredPolicies { get; }

Property Value

bool

true if deletion is driven by the declared policies; false if this contributor applies its own, self-contained rule (for example a fixed age bound on its own table).

Remarks

A contributor that returns false is always handed an EMPTY Policies list, so it cannot act on a population it said it does not use. Enforcement refuses to start when any contributor returns true and no retention scope has been declared, because such a contributor would otherwise have nothing trustworthy to act on.

Name

Gets the human-readable name of this contributor (used in diagnostics).

string Name { get; }

Property Value

string

Methods

EnforceAsync(RetentionContributorContext, CancellationToken)

Enforces the supplied retention policies against this contributor's store, deleting records whose retention period has elapsed relative to AsOf.

Task<RetentionContributorResult> EnforceAsync(RetentionContributorContext context, CancellationToken cancellationToken)

Parameters

context RetentionContributorContext

The retention enforcement context (policies, dry-run flag, evaluation time).

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<RetentionContributorResult>

The outcome, including the number of records cleaned.