Class GovernanceOutboxEntry
- Namespace
- AsiBackbone.Core.Outbox
- Assembly
- AsiBackbone.Core.dll
Represents a provider-neutral durable outbox entry for a governance emission envelope.
public sealed class GovernanceOutboxEntry
- Inheritance
-
GovernanceOutboxEntry
- Inherited Members
Remarks
Outbox entries are intended to be persisted before optional downstream provider delivery is attempted.
Properties
CreatedUtc
Gets the UTC timestamp when the outbox entry was created.
public DateTimeOffset CreatedUtc { get; }
Property Value
DeadLetterReason
Gets the dead-letter reason, when the entry has reached a terminal dead-letter state.
public string? DeadLetterReason { get; }
Property Value
Envelope
Gets the provider-neutral governance emission envelope being persisted for delivery.
public GovernanceEmissionEnvelope Envelope { get; }
Property Value
HasMetadata
Gets a value indicating whether metadata is present.
public bool HasMetadata { get; }
Property Value
IsDeadLettered
Gets a value indicating whether this entry has reached a terminal dead-letter state.
public bool IsDeadLettered { get; }
Property Value
IsDelivered
Gets a value indicating whether this entry was delivered successfully.
public bool IsDelivered { get; }
Property Value
LastError
Gets the last provider-neutral emission error, when available.
public GovernanceEmissionError? LastError { get; }
Property Value
MaxRetryCount
Gets the maximum retry count before the entry should transition to dead-lettered.
public int MaxRetryCount { get; }
Property Value
Metadata
Gets minimized provider-neutral outbox metadata.
public IReadOnlyDictionary<string, string> Metadata { get; }
Property Value
NextRetryUtc
Gets the next UTC retry timestamp, when retry scheduling is active.
public DateTimeOffset? NextRetryUtc { get; }
Property Value
OutboxEntryId
Gets the stable outbox entry identifier.
public string OutboxEntryId { get; }
Property Value
ProviderName
Gets the provider name associated with the most recent attempt, when available.
public string? ProviderName { get; }
Property Value
ProviderRecordId
Gets the provider-side record identifier, when delivery returned one and it is safe to store.
public string? ProviderRecordId { get; }
Property Value
RetryCount
Gets the number of failed or deferred delivery attempts recorded for this entry.
public int RetryCount { get; }
Property Value
Status
Gets the current provider-neutral outbox status.
public GovernanceEmissionStatus Status { get; }
Property Value
UpdatedUtc
Gets the UTC timestamp when the outbox entry was last updated.
public DateTimeOffset UpdatedUtc { get; }
Property Value
Methods
Create(GovernanceEmissionEnvelope, string?, DateTimeOffset?, int, IReadOnlyDictionary<string, string>?)
Creates a pending durable governance outbox entry.
public static GovernanceOutboxEntry Create(GovernanceEmissionEnvelope envelope, string? outboxEntryId = null, DateTimeOffset? createdUtc = null, int maxRetryCount = 5, IReadOnlyDictionary<string, string>? metadata = null)
Parameters
envelopeGovernanceEmissionEnvelopeoutboxEntryIdstringcreatedUtcDateTimeOffset?maxRetryCountintmetadataIReadOnlyDictionary<string, string>
Returns
IsRetryReady(DateTimeOffset)
Determines whether the entry is ready for retry at the supplied UTC timestamp.
public bool IsRetryReady(DateTimeOffset utcNow)
Parameters
utcNowDateTimeOffset
Returns
MarkDeadLettered(GovernanceEmissionError, string?, DateTimeOffset?)
Returns a dead-lettered copy of this entry.
public GovernanceOutboxEntry MarkDeadLettered(GovernanceEmissionError governanceEmissionError, string? deadLetterReason = null, DateTimeOffset? updatedUtc = null)
Parameters
governanceEmissionErrorGovernanceEmissionErrordeadLetterReasonstringupdatedUtcDateTimeOffset?
Returns
MarkDeferred(GovernanceEmissionError?, DateTimeOffset?, DateTimeOffset?)
Returns a deferred copy of this entry.
public GovernanceOutboxEntry MarkDeferred(GovernanceEmissionError? governanceEmissionError = null, DateTimeOffset? nextRetryUtc = null, DateTimeOffset? updatedUtc = null)
Parameters
governanceEmissionErrorGovernanceEmissionErrornextRetryUtcDateTimeOffset?updatedUtcDateTimeOffset?
Returns
MarkDelivered(GovernanceEmissionResult, DateTimeOffset?)
Returns a delivered copy of this entry.
public GovernanceOutboxEntry MarkDelivered(GovernanceEmissionResult result, DateTimeOffset? updatedUtc = null)
Parameters
resultGovernanceEmissionResultupdatedUtcDateTimeOffset?
Returns
MarkFailed(GovernanceEmissionError, DateTimeOffset?, DateTimeOffset?)
Returns a failed or retryable-failure copy of this entry.
public GovernanceOutboxEntry MarkFailed(GovernanceEmissionError governanceEmissionError, DateTimeOffset? nextRetryUtc = null, DateTimeOffset? updatedUtc = null)
Parameters
governanceEmissionErrorGovernanceEmissionErrornextRetryUtcDateTimeOffset?updatedUtcDateTimeOffset?
Returns
Restore(GovernanceEmissionEnvelope, GovernanceEmissionStatus, string, DateTimeOffset, DateTimeOffset, int, int, DateTimeOffset?, GovernanceEmissionError?, string?, string?, string?, IReadOnlyDictionary<string, string>?)
Restores a durable outbox entry from provider-neutral storage.
public static GovernanceOutboxEntry Restore(GovernanceEmissionEnvelope envelope, GovernanceEmissionStatus status, string outboxEntryId, DateTimeOffset createdUtc, DateTimeOffset updatedUtc, int retryCount = 0, int maxRetryCount = 5, DateTimeOffset? nextRetryUtc = null, GovernanceEmissionError? lastError = null, string? providerName = null, string? providerRecordId = null, string? deadLetterReason = null, IReadOnlyDictionary<string, string>? metadata = null)
Parameters
envelopeGovernanceEmissionEnvelopestatusGovernanceEmissionStatusoutboxEntryIdstringcreatedUtcDateTimeOffsetupdatedUtcDateTimeOffsetretryCountintmaxRetryCountintnextRetryUtcDateTimeOffset?lastErrorGovernanceEmissionErrorproviderNamestringproviderRecordIdstringdeadLetterReasonstringmetadataIReadOnlyDictionary<string, string>
Returns
Remarks
This factory exists for storage adapters. It does not perform provider emission and does not add any provider dependency to Core.