feat(host): add NodeName to NodeOptions + INodeIdentityProvider

- NodeName: semantic role-within-cluster identifier (node-a/node-b on sites,
  central-a/central-b on central). Bound from ScadaLink:Node:NodeName.
- INodeIdentityProvider exposes the trimmed name (null if unconfigured) so
  downstream audit writers can stamp the new SourceNode column.
This commit is contained in:
Joseph Doherty
2026-05-23 15:38:27 -04:00
parent 9e5e32d0f2
commit 2e10cbe42d
6 changed files with 110 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
namespace ScadaLink.Commons.Interfaces.Services;
/// <summary>
/// Surfaces the local node's semantic role-within-cluster name so downstream
/// audit writers can stamp it on the SourceNode column.
/// </summary>
/// <remarks>
/// Conventional values follow the pattern <c>node-a</c>/<c>node-b</c> on site
/// nodes and <c>central-a</c>/<c>central-b</c> on central nodes. The value is
/// a free-form operator-supplied label — there is no enforced format. When the
/// configuration value is missing, empty, or whitespace, implementations
/// return <c>null</c> so audit writers can persist NULL rather than an empty
/// string.
/// </remarks>
public interface INodeIdentityProvider
{
/// <summary>
/// The configured semantic node name, trimmed of surrounding whitespace.
/// <c>null</c> when unconfigured.
/// </summary>
string? NodeName { get; }
}