From 5f0e0482ede81d8b1afbfd8603ed9c7c17613dbb Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Thu, 28 May 2026 09:14:57 -0400 Subject: [PATCH] refactor(driver-opcuaclient): extract OpcUaClientDriverOptions to .Contracts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move OpcUaClientDriverOptions and all companion enums (OpcUaTargetNamespaceKind, OpcUaSecurityMode, OpcUaSecurityPolicy, OpcUaAuthType) to a new Driver.OpcUaClient.Contracts sibling project. The options file had no using directives — all types were defined in the same file — so no NuGet mirror enum pattern was required. Convert two doc-comment references: OpcUaClientDriver.InitializeAsync OpcUaClientDriver.ValidateNamespaceKind per the approved decision — no compilable usings were present. The runtime Driver.OpcUaClient project gains a ProjectReference to .Contracts; the .slnx is updated accordingly. --- ZB.MOM.WW.OtOpcUa.slnx | 1 + .../OpcUaClientDriverOptions.cs | 4 ++-- ...ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Contracts.csproj | 9 +++++++++ .../ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.csproj | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) rename src/Drivers/{ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient => ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Contracts}/OpcUaClientDriverOptions.cs (98%) create mode 100644 src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Contracts/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Contracts.csproj diff --git a/ZB.MOM.WW.OtOpcUa.slnx b/ZB.MOM.WW.OtOpcUa.slnx index 974386b7..eeb553ea 100644 --- a/ZB.MOM.WW.OtOpcUa.slnx +++ b/ZB.MOM.WW.OtOpcUa.slnx @@ -37,6 +37,7 @@ + diff --git a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient/OpcUaClientDriverOptions.cs b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Contracts/OpcUaClientDriverOptions.cs similarity index 98% rename from src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient/OpcUaClientDriverOptions.cs rename to src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Contracts/OpcUaClientDriverOptions.cs index 40292a34..6449777e 100644 --- a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient/OpcUaClientDriverOptions.cs +++ b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Contracts/OpcUaClientDriverOptions.cs @@ -23,7 +23,7 @@ public sealed class OpcUaClientDriverOptions /// /// Ordered list of candidate endpoint URLs for failover. The driver tries each in - /// order at and on session drop; + /// order at OpcUaClientDriver.InitializeAsync and on session drop; /// the first URL that successfully connects wins. Typical use-case: an OPC UA server /// pair running in hot-standby (primary 4840 + backup 4841) where either can serve /// the same address space. Leave unset (or empty) to use @@ -148,7 +148,7 @@ public sealed class OpcUaClientDriverOptions /// the remote browse path with no UNS conversion. /// /// The driver enforces the choice at startup — see - /// — so a misconfiguration fails + /// OpcUaClientDriver.ValidateNamespaceKind — so a misconfiguration fails /// draft validation rather than surfacing as a runtime surprise. /// public OpcUaTargetNamespaceKind TargetNamespaceKind { get; init; } = OpcUaTargetNamespaceKind.Equipment; diff --git a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Contracts/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Contracts.csproj b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Contracts/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Contracts.csproj new file mode 100644 index 00000000..3896f7bd --- /dev/null +++ b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Contracts/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Contracts.csproj @@ -0,0 +1,9 @@ + + + net10.0 + enable + enable + true + + + diff --git a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.csproj b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.csproj index 67941474..d41c0dce 100644 --- a/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.csproj +++ b/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.csproj @@ -13,6 +13,7 @@ +