Skip to content

RetentionPolicyResolver

Namespace AgentPrism · Assembly AgentPrism.Core.dll

Combines the database policy with the configuration default for a target.

public sealed class RetentionPolicyResolver

objectRetentionPolicyResolver

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

Order: first the explicit record in IRetentionPolicyStore (tenant, then "*") is looked up; if found, configuration is not consulted at all. If there is no record, AgentPrismRetentionOptions takes over, but only while AgentPrismRetentionOptions.Enabled is on.

RetentionPolicyResolver(IRetentionPolicyStore, IOptionsMonitor<AgentPrismRetentionOptions>)

Section titled “ RetentionPolicyResolver(IRetentionPolicyStore, IOptionsMonitor<AgentPrismRetentionOptions>)”

Combines the database policy with the configuration default for a target.

public RetentionPolicyResolver(IRetentionPolicyStore policyStore, IOptionsMonitor<AgentPrismRetentionOptions> optionsMonitor)

policyStore IRetentionPolicyStore

optionsMonitor IOptionsMonitor<AgentPrismRetentionOptions>

Order: first the explicit record in IRetentionPolicyStore (tenant, then "*") is looked up; if found, configuration is not consulted at all. If there is no record, AgentPrismRetentionOptions takes over, but only while AgentPrismRetentionOptions.Enabled is on.

ResolveAsync(string, string, CancellationToken)

Section titled “ ResolveAsync(string, string, CancellationToken)”

Resolves the effective retention rule for a target.

public ValueTask<ResolvedRetentionPolicy?> ResolveAsync(string tenantId, string target, CancellationToken cancellationToken = default)

tenantId string

The tenant identity.

target string

The target name.

cancellationToken CancellationToken

The cancellation token.

ValueTask<ResolvedRetentionPolicy?>

The effective rule; null if nothing is to be deleted.