Files
lmxopcua/src/Core/ZB.MOM.WW.OtOpcUa.Commons/Protos/MeshTransportProtoContract.cs
T
2026-08-06 02:53:50 -04:00

34 lines
1.7 KiB
C#

using ZB.MOM.WW.OtOpcUa.Commons.Protos.MeshTransport.V1;
namespace ZB.MOM.WW.OtOpcUa.Commons.Protos;
/// <summary>
/// The single source of truth for which <see cref="CommandEnvelope.CommandOneofCase"/> variants
/// the cross-mesh command transport actually handles. Both the contract-lock test (which proves
/// this list stays in lock-step with the generated oneof) and the oneof↔domain mapper reference
/// this array, so adding a fifth command to <c>mesh_transport.proto</c> forces a matching entry
/// here or the build/test goes red.
/// </summary>
/// <remarks>
/// Mirrors <see cref="TelemetryProtoContract"/>, and for a sharper reason: a telemetry variant
/// nobody handles loses an observation, whereas a command variant nobody handles loses a
/// deployment, a driver restart or an alarm acknowledgement — silently, since the sender's ack
/// only ever meant "received".
/// </remarks>
public static class MeshTransportProtoContract
{
/// <summary>
/// Exactly the four cross-mesh command oneof cases mirrored from the domain records:
/// DispatchDeployment / RestartDriver / ReconnectDriver / AlarmCommand. The fifth message on
/// this contract, <c>ApplyAckMessage</c>, travels the opposite direction on its own RPC and is
/// not a oneof member, so it is deliberately absent from this list.
/// </summary>
public static readonly CommandEnvelope.CommandOneofCase[] HandledCases =
[
CommandEnvelope.CommandOneofCase.DispatchDeployment,
CommandEnvelope.CommandOneofCase.RestartDriver,
CommandEnvelope.CommandOneofCase.ReconnectDriver,
CommandEnvelope.CommandOneofCase.AlarmCommand,
];
}