From b83f0993941044d209252543a12f4db83566aa74 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Tue, 26 May 2026 05:17:59 -0400 Subject: [PATCH] feat(adminui): IFleetDiagnosticsClient skeleton (Akka round-trip tracked as F17) --- .../Clients/FleetDiagnosticsClient.cs | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Clients/FleetDiagnosticsClient.cs diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Clients/FleetDiagnosticsClient.cs b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Clients/FleetDiagnosticsClient.cs new file mode 100644 index 0000000..199445a --- /dev/null +++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Clients/FleetDiagnosticsClient.cs @@ -0,0 +1,36 @@ +using Akka.Actor; +using ZB.MOM.WW.OtOpcUa.Commons.Interfaces; +using ZB.MOM.WW.OtOpcUa.Commons.Types; + +namespace ZB.MOM.WW.OtOpcUa.AdminUI.Clients; + +/// +/// that targets a named node's DriverHostActor over +/// Akka cluster . +/// +/// The actual GetDiagnosticsRequest/NodeDiagnosticsSnapshot round-trip on the +/// driver side is staged for follow-up F17 (depends on DriverHostActor exposing the request +/// handler; right now it only handles DispatchDeployment). For now the client returns an empty +/// snapshot so the UI can render a "no data yet" state. +/// +public sealed class FleetDiagnosticsClient : IFleetDiagnosticsClient +{ + private readonly ActorSystem _system; + + public FleetDiagnosticsClient(ActorSystem system) + { + _system = system; + } + + public Task GetDiagnosticsAsync(NodeId nodeId, CancellationToken ct) + { + // F17: ActorSelection at $"akka.tcp://{system}@{nodeId.Value}:4053/user/driver-host" + // → Ask(new GetDiagnostics(), timeout). + var snapshot = new NodeDiagnosticsSnapshot( + nodeId, + CurrentRevision: null, + Drivers: Array.Empty(), + AsOfUtc: DateTime.UtcNow); + return Task.FromResult(snapshot); + } +}