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.
36 lines
1.6 KiB
C#
36 lines
1.6 KiB
C#
using Microsoft.Extensions.Options;
|
|
using ZB.MOM.WW.ScadaBridge.StoreAndForward;
|
|
|
|
namespace ZB.MOM.WW.ScadaBridge.Host;
|
|
|
|
/// <summary>
|
|
/// Host-side adapter implementing the
|
|
/// optional <see cref="IStoreAndForwardSiteContext"/> the Store-and-Forward
|
|
/// service consults to stamp cached-call audit telemetry with the site id.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Forwards <see cref="NodeOptions.SiteId"/> verbatim — the same value
|
|
/// <see cref="SiteIdentityProvider"/> exposes to HealthMonitoring. Defined as
|
|
/// a separate adapter (rather than reusing <see cref="SiteIdentityProvider"/>)
|
|
/// to avoid pulling HealthMonitoring into the StoreAndForward project's
|
|
/// dependency graph, which would create a project-reference cycle.
|
|
/// </remarks>
|
|
public class StoreAndForwardSiteContext : IStoreAndForwardSiteContext
|
|
{
|
|
/// <inheritdoc />
|
|
public string SiteId { get; }
|
|
|
|
/// <summary>Initializes a new instance of <see cref="StoreAndForwardSiteContext"/>.</summary>
|
|
/// <param name="nodeOptions">Node options supplying the site identifier.</param>
|
|
public StoreAndForwardSiteContext(IOptions<NodeOptions> nodeOptions)
|
|
{
|
|
// NodeOptions.SiteId is nullable; SiteServiceRegistration ONLY adds
|
|
// this binding on the site role, so a non-null site id is expected
|
|
// here. Mirror SiteIdentityProvider's hard fail so a missing site id
|
|
// surfaces at composition time rather than at the first cached call.
|
|
SiteId = nodeOptions.Value.SiteId
|
|
?? throw new InvalidOperationException(
|
|
"ScadaBridge:Node:SiteId is required for the site role's StoreAndForward wiring.");
|
|
}
|
|
}
|