RetentionExecutor
AgentPrism.Core.dllProvides shared logic for preview and actual cleanup runs. RetentionJobHandler
and the RetentionEndpoints “run now” and “preview” endpoints use it.
public sealed class RetentionExecutorInheritance
Section titled “Inheritance”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
Section titled “Constructors”RetentionExecutor(IRetentionPolicyStore, IRetentionStore, RetentionPolicyResolver, IOptionsMonitor<AgentPrismRetentionOptions>, IArchiveSink?, TimeProvider?, ILogger<RetentionExecutor>?)
Section titled “ RetentionExecutor(IRetentionPolicyStore, IRetentionStore, RetentionPolicyResolver, IOptionsMonitor<AgentPrismRetentionOptions>, IArchiveSink?, TimeProvider?, ILogger<RetentionExecutor>?)”Provides shared logic for preview and actual cleanup runs. RetentionJobHandler
and the RetentionEndpoints “run now” and “preview” endpoints use it.
public RetentionExecutor(IRetentionPolicyStore policyStore, IRetentionStore dataStore, RetentionPolicyResolver resolver, IOptionsMonitor<AgentPrismRetentionOptions> optionsMonitor, IArchiveSink? archiveSink = null, TimeProvider? timeProvider = null, ILogger<RetentionExecutor>? logger = null)Parameters
Section titled “Parameters”policyStore IRetentionPolicyStore
dataStore IRetentionStore
resolver RetentionPolicyResolver
optionsMonitor IOptionsMonitor<AgentPrismRetentionOptions>
archiveSink IArchiveSink?
timeProvider TimeProvider?
logger ILogger<RetentionExecutor>?
Methods
Section titled “Methods”PreviewAsync(string, string?, CancellationToken)
Section titled “ PreviewAsync(string, string?, CancellationToken)”Returns a “what would happen now” preview for one or all targets.
public ValueTask<IReadOnlyList<RetentionPreview>> PreviewAsync(string tenantId, string? target, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”tenantId string
The tenant identifier.
target string?
The sole target, or null for every known target.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”ValueTask<IReadOnlyList<RetentionPreview>>
A preview for each target.
RunAsync(string, string?, CancellationToken)
Section titled “ RunAsync(string, string?, CancellationToken)”Runs actual cleanup for one or all targets.
public ValueTask<IReadOnlyList<RetentionRun>> RunAsync(string tenantId, string? target, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”tenantId string
The tenant identifier.
target string?
The sole target, or null for every known target.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”ValueTask<IReadOnlyList<RetentionRun>>
The completed, or no-op, run records.