Interface IAuditAnnotationStore
- Namespace
- Excalibur.Compliance
- Assembly
- Excalibur.Compliance.Abstractions.dll
Stores annotations (tags, bookmarks, notes) linked to audit events.
public interface IAuditAnnotationStore
Remarks
Annotations are additive — they never modify the original AuditEvent or its hash chain. Each annotation is a separate record linked by event ID.
Implementations must be thread-safe. Duplicate tags on the same event are idempotent.
Methods
AnnotateAsync(string, string, CancellationToken)
Adds a free-text note to an audit event.
Task<AuditAnnotationId> AnnotateAsync(string eventId, string note, CancellationToken cancellationToken)
Parameters
eventIdstringThe audit event to annotate.
notestringThe note text.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<AuditAnnotationId>
The identifier of the created annotation.
BookmarkAsync(string, string?, CancellationToken)
Bookmarks an event for the current actor with an optional label.
Task BookmarkAsync(string eventId, string? label, CancellationToken cancellationToken)
Parameters
eventIdstringThe audit event to bookmark.
labelstringAn optional label for the bookmark.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
GetAnnotationsAsync(string, CancellationToken)
Retrieves all annotations for a given audit event.
Task<AuditAnnotations> GetAnnotationsAsync(string eventId, CancellationToken cancellationToken)
Parameters
eventIdstringThe audit event to retrieve annotations for.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<AuditAnnotations>
The aggregated annotations for the event.
QueryByAnnotationAsync(AuditAnnotationQuery, CancellationToken)
Queries events by annotation criteria (tags, bookmarked, has-notes).
Task<IReadOnlyList<string>> QueryByAnnotationAsync(AuditAnnotationQuery query, CancellationToken cancellationToken)
Parameters
queryAuditAnnotationQueryThe annotation query parameters.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
- Task<IReadOnlyList<string>>
A list of matching audit event IDs.
RemoveBookmarkAsync(string, CancellationToken)
Removes a bookmark from an event for the current actor.
Task RemoveBookmarkAsync(string eventId, CancellationToken cancellationToken)
Parameters
eventIdstringThe audit event to remove the bookmark from.
cancellationTokenCancellationTokenA token to cancel the operation.
Returns
TagAsync(string, IReadOnlyList<string>, CancellationToken)
Adds tags to an audit event. Duplicate tags are idempotent.
Task TagAsync(string eventId, IReadOnlyList<string> tags, CancellationToken cancellationToken)
Parameters
eventIdstringThe audit event to tag.
tagsIReadOnlyList<string>The tag labels to apply.
cancellationTokenCancellationTokenA token to cancel the operation.