feat(auditlog): extend ISiteStreamAuditClient with IngestCachedTelemetryAsync (#23 M3)
Add the second site→central RPC seam alongside the existing M2 IngestAuditEventsAsync. The Bundle D proto already lit up IngestCachedTelemetry (CachedTelemetryBatch / IngestAck) so this commit just plumbs the client-side abstraction: * ISiteStreamAuditClient gains IngestCachedTelemetryAsync(batch, ct). * NoOpSiteStreamAuditClient implements it returning an empty IngestAck (same shape as M2 — production gRPC client lands in M6). * SyncCallEmissionEndToEndTests' DirectActorSiteStreamAuditClient stub throws NotSupportedException from the new method so a regression that accidentally routes a cached packet through the sync stub fails loudly. * New NoOpSiteStreamAuditClientTests cover the null-guard + empty-ack contract for both batch shapes. Bundle E task E1.
This commit is contained in:
@@ -20,4 +20,23 @@ public interface ISiteStreamAuditClient
|
||||
/// in the site SQLite queue.
|
||||
/// </summary>
|
||||
Task<IngestAck> IngestAuditEventsAsync(AuditEventBatch batch, CancellationToken ct);
|
||||
|
||||
/// <summary>
|
||||
/// Pushes the combined <see cref="CachedTelemetryBatch"/> (Audit Log #23 / M3)
|
||||
/// to the central <c>IngestCachedTelemetry</c> RPC. Each packet carries both
|
||||
/// the audit row and the operational <c>SiteCalls</c> upsert; central writes
|
||||
/// both in a single MS SQL transaction. Returns the same
|
||||
/// <see cref="IngestAck"/> shape as <see cref="IngestAuditEventsAsync"/> so
|
||||
/// the M3 site-side forwarder can flip the underlying audit rows to
|
||||
/// <see cref="ScadaLink.Commons.Types.Enums.AuditForwardState.Forwarded"/>
|
||||
/// once central has acknowledged them.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The production gRPC-backed implementation lands in M6 (no site→central
|
||||
/// gRPC channel exists today); until then the default
|
||||
/// <see cref="NoOpSiteStreamAuditClient"/> binding returns an empty ack and
|
||||
/// integration tests substitute a direct-actor client that routes the batch
|
||||
/// straight into the in-process <c>AuditLogIngestActor</c>.
|
||||
/// </remarks>
|
||||
Task<IngestAck> IngestCachedTelemetryAsync(CachedTelemetryBatch batch, CancellationToken ct);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user