namespace ZB.MOM.WW.OtOpcUa.Commons.OpcUa; /// /// The parsed OpcUa:Redundancy:Mode (Gitea #717). Startup-static: changing it requires a restart. /// public enum OpcUaRedundancyMode { /// Not opted in (the default): byte-for-byte the pre-#717 server. Nothing in the redundancy metadata, /// ServiceLevel bands, projection or alarm delivery changes. Unset = 0, /// Standalone: advertises RedundancySupport=None with no ServerUriArray; never projects. None = 1, /// A 2-node pair with a degraded standby (spec §4): non-transparent Warm metadata, Standby bands below /// every Active level, ordinary-tag values projected BadOutOfService on the Standby, new alarm events /// suppressed there, and writes / Part 9 methods refused BadInvalidState there. Warm = 2, } /// /// The runtime half of OpcUa:Redundancy (Gitea #717): what the redundancy actors need. The Host builds it /// from the validated OpcUaApplicationHostOptions and registers it as a singleton; a node that registers /// none (a harness, an admin-only node) is . /// /// The redundancy mode. /// Warm only: let the survivor go Active while the Primary is /// unreachable but not yet downed (spec §4.1, owner answer Q2). Default on. public sealed record WarmRedundancySettings(OpcUaRedundancyMode Mode, bool PromoteWhilePrimaryUnreachable = true) { /// The not-opted-in default. public static WarmRedundancySettings Unset { get; } = new(OpcUaRedundancyMode.Unset); /// True when this node runs the Warm role contract. public bool IsWarm => Mode == OpcUaRedundancyMode.Warm; }