Skip to content

RetentionExecutor

Namespace AgentPrism · Assembly AgentPrism.Core.dll

Provides shared logic for preview and actual cleanup runs. RetentionJobHandler and the RetentionEndpoints “run now” and “preview” endpoints use it.

public sealed class RetentionExecutor

objectRetentionExecutor

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

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)

policyStore IRetentionPolicyStore

dataStore IRetentionStore

resolver RetentionPolicyResolver

optionsMonitor IOptionsMonitor<AgentPrismRetentionOptions>

archiveSink IArchiveSink?

timeProvider TimeProvider?

logger ILogger<RetentionExecutor>?

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)

tenantId string

The tenant identifier.

target string?

The sole target, or null for every known target.

cancellationToken CancellationToken

The cancellation token.

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)

tenantId string

The tenant identifier.

target string?

The sole target, or null for every known target.

cancellationToken CancellationToken

The cancellation token.

ValueTask<IReadOnlyList<RetentionRun>>

The completed, or no-op, run records.