AgentFileAuditLog class final

The audit log as a stream of files over an AgentAuditStore: one file per appended batch, filed under the UTC day it was written (<yyyy-mm-dd>/<µs>-<instance>-<n>.json).

One file per batch, never a rewrite. An append writes one new file and reads nothing, so two appenders never lose each other's writes. The day folders are the rotation, and retention deletes whole days.

The store should be dedicated to the stream: open lists it.

Inheritance

Properties

appended → Stream<List<AgentAuditEntry>>
Each appended batch, as it lands — what a viewer repaints from.
no setterinherited
clock → DateTime Function()
finalinherited
entries → List<AgentAuditEntry>
Every retained entry, oldest first.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
retention → Duration
How long an entry is kept.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
store → AgentAuditStore
final

Methods

append(Iterable<AgentAuditEntry> batch) → List<AgentAuditEntry>
Appends batch in order, numbering it after everything already in the log, and answers the entries as stored.
inherited
applyRetention(Duration value) → void
Adopts a new retention, dropping what it no longer covers — from entries at once and from storage as soon as earlier writes have landed. Settings are often read after the log is open, so this is how a configured value arrives.
inherited
dispose() → Future<void>
inherited
flush() → Future<void>
Waits until every appended batch has been handed to storage.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
persist(List<AgentAuditEntry> batch) → void
Stores batch. Called once per append, in order.
override
pruneStorage() → void
Deletes from storage what retention no longer covers.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

open(AgentAuditStore store, {Duration retention = AgentAuditLog.defaultRetention, DateTime clock()?}) → Future<AgentFileAuditLog>
Opens the stream over store: reads what is retained, deletes what is not, and continues numbering after the highest opId found.

Constants

formatVersion → const int
The on-disk format of one batch file.