9cff87fe85
Remove project bookkeeping citations from shipped code comments across the solution: hyphenated task IDs (WP-14, StoreAndForward-025), milestone/task/ issue refs (M3, Task 4, Audit Log #23, #21), Bundle X task-bundle labels, and C/D/K/S/T phase labels. Comment text only — no code logic, string/log literals, or XML-doc structure changed. Genuine descriptions are preserved (only the citation is stripped), and technical lookalikes are retained (UTF-8, SHA-256, T00:00:00, M365, UTC-5, pre-C4/pre-C5 schema versions). Flagged by the new CommentChecker TaskReferenceInComment / TrackingReferenceInComment checks plus targeted grep passes; full solution builds clean, append-only guard tests pass.
58 lines
3.0 KiB
C#
58 lines
3.0 KiB
C#
using ZB.MOM.WW.ScadaBridge.Commons.Messages.Integration;
|
|
|
|
namespace ZB.MOM.WW.ScadaBridge.AuditLog.Central;
|
|
|
|
/// <summary>
|
|
/// Mockable abstraction over the central-side <c>PullSiteCalls</c> gRPC client
|
|
/// surface used by the Site Call Audit reconciliation tick to fetch the
|
|
/// next batch of cached-call operational rows from a specific site — the
|
|
/// documented periodic self-heal pull that backfills the eventually-consistent
|
|
/// central <c>SiteCalls</c> mirror when best-effort push telemetry is lost.
|
|
/// Extracted so the (separate, follow-up) reconciliation actor can be
|
|
/// unit-tested against an in-memory stub without standing up a real
|
|
/// <c>GrpcChannel</c> per site.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// The home is <c>ZB.MOM.WW.ScadaBridge.AuditLog.Central</c> rather than the
|
|
/// <c>ZB.MOM.WW.ScadaBridge.SiteCallAudit</c> project so it can reuse the
|
|
/// <see cref="ISiteEnumerator"/> / <see cref="SiteEntry"/> endpoint-resolution
|
|
/// abstraction that already lives here (and that the sibling
|
|
/// <see cref="IPullAuditEventsClient"/> uses) — SiteCallAudit does not reference
|
|
/// AuditLog, so hosting the client there would mean duplicating the enumerator.
|
|
/// This mirrors the decision to keep <see cref="SiteCallDtoMapper"/> in
|
|
/// <c>ZB.MOM.WW.ScadaBridge.Communication</c>.
|
|
/// </para>
|
|
/// <para>
|
|
/// Implementations MUST NOT throw on transport faults the reconciliation tick
|
|
/// can tolerate (connection refused, deadline exceeded, cancellation) — one
|
|
/// offline site must never sink the rest of the tick. The
|
|
/// <see cref="PullSiteCallsResponse.SiteCalls"/> are returned oldest-first by
|
|
/// <c>UpdatedAtUtc</c> with the <c>SourceSite</c> re-stamped from the dialed
|
|
/// site id (the site leaves it empty, being unaware of its own id), and a
|
|
/// <c>MoreAvailable</c> flag the caller uses to decide whether to fire another
|
|
/// pull immediately.
|
|
/// </para>
|
|
/// </remarks>
|
|
public interface IPullSiteCallsClient
|
|
{
|
|
/// <summary>
|
|
/// Issues a <c>PullSiteCalls</c> RPC against the site whose gRPC endpoint is
|
|
/// registered against <paramref name="siteId"/>. Returns the next batch of
|
|
/// <see cref="ZB.MOM.WW.ScadaBridge.Commons.Entities.Audit.SiteCall"/> rows
|
|
/// ordered oldest-first (with <c>SourceSite</c> re-stamped from
|
|
/// <paramref name="siteId"/>) AND a <c>MoreAvailable</c> flag the caller uses
|
|
/// to decide whether to fire another pull immediately.
|
|
/// </summary>
|
|
/// <param name="siteId">The identifier of the site to pull cached-call operational rows from.</param>
|
|
/// <param name="sinceUtc">Only rows with an <c>UpdatedAtUtc</c> at or after this cursor time are returned.</param>
|
|
/// <param name="batchSize">Maximum number of rows to return per call.</param>
|
|
/// <param name="ct">Cancellation token.</param>
|
|
/// <returns>A task that resolves to the next reconciliation batch with a <c>MoreAvailable</c> flag.</returns>
|
|
Task<PullSiteCallsResponse> PullAsync(
|
|
string siteId,
|
|
DateTime sinceUtc,
|
|
int batchSize,
|
|
CancellationToken ct);
|
|
}
|