From f626ece66a298af2395efa724cc77567045f19e4 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Fri, 29 May 2026 07:44:07 -0400 Subject: [PATCH] feat(commons): add MxGatewayEndpointConfig type --- .../MxGatewayEndpointConfig.cs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/ZB.MOM.WW.ScadaBridge.Commons/Types/DataConnections/MxGatewayEndpointConfig.cs diff --git a/src/ZB.MOM.WW.ScadaBridge.Commons/Types/DataConnections/MxGatewayEndpointConfig.cs b/src/ZB.MOM.WW.ScadaBridge.Commons/Types/DataConnections/MxGatewayEndpointConfig.cs new file mode 100644 index 00000000..f1fdbd29 --- /dev/null +++ b/src/ZB.MOM.WW.ScadaBridge.Commons/Types/DataConnections/MxGatewayEndpointConfig.cs @@ -0,0 +1,27 @@ +namespace ZB.MOM.WW.ScadaBridge.Commons.Types.DataConnections; + +/// +/// Per-endpoint configuration for an MxGateway data connection. Serialized to the +/// typed JSON shape stored in DataConnection.PrimaryConfiguration / +/// BackupConfiguration. Both primary and backup use this same shape — the +/// backup is simply a second gateway endpoint for failover. +/// +public class MxGatewayEndpointConfig +{ + /// Gateway base URL (e.g. "http://localhost:5000"). + public string Endpoint { get; set; } = "http://localhost:5000"; + /// API key sent to the gateway as authorization: Bearer <key>. + public string ApiKey { get; set; } = ""; + /// MXAccess client registration name. Blank → derive "scadabridge-<connName>" at connect time. + public string ClientName { get; set; } = ""; + /// MXAccess user id applied to every write-back. 0 = no user context. + public int WriteUserId { get; set; } + /// Use TLS to a secured gateway. + public bool UseTls { get; set; } + /// Path to the CA certificate (TLS only). + public string CaFile { get; set; } = ""; + /// TLS server-name override. + public string ServerName { get; set; } = ""; + /// ReadBulk per-call timeout in milliseconds. + public int ReadTimeoutMs { get; set; } = 5000; +}