using Akka.Actor; using ZB.MOM.WW.ScadaBridge.Commons.Messages.Audit; using ZB.MOM.WW.ScadaBridge.Commons.Messages.Deployment; using ZB.MOM.WW.ScadaBridge.Commons.Messages.Health; using ZB.MOM.WW.ScadaBridge.Commons.Messages.Notification; namespace ZB.MOM.WW.ScadaBridge.Communication.Actors; /// /// The site→central transport seam: one method per the seven messages /// sends to /user/central-communication today. /// /// /// /// The actor's receive handlers no longer own the wire plumbing — they capture the current /// Sender and hand it to the transport as . Two implementations /// exist behind the ScadaBridge:Communication:CentralTransport flag: the default /// (verbatim of the old ClusterClient.Send path, /// including the exact sender-forwarding that routes central's reply straight back to the waiting /// Ask) and (a gRPC dial of CentralControlService). /// /// /// Reply/fault contract, identical on both transports. Each Ask-returning method (all but /// the heartbeat) guarantees exactly one reply eventually lands at : /// either the real reply type the caller Asks for, or a transient-failure signal. The Akka path /// sends a not-accepted ack / when no ClusterClient is registered; /// the gRPC path sends on any non-OK status (a timeout or an /// Unavailable that could not be failed over). Both are what the S&F / audit / health /// layers above the seam already treat as transient — rows stay buffered, counters restore, the /// pass re-runs. /// /// /// The heartbeat stays fire-and-forget end-to-end. takes no /// replyTo and never surfaces a fault: a transport failure is swallowed and logged, exactly /// as the old Tell dropped it. A failing heartbeat must never fault the site's heartbeat /// timer path. /// /// public interface ICentralTransport { /// Forwards a buffered notification; central replies to . /// The notification submission. /// The actor (the S&F forwarder's Ask) the ack routes back to. void SubmitNotification(NotificationSubmit message, IActorRef replyTo); /// Forwards a Notify.Status query; central replies to . /// The status query. /// The actor (the Notify helper's Ask) the response routes back to. void QueryNotificationStatus(NotificationStatusQuery message, IActorRef replyTo); /// Pushes a batch of audit events; central replies to . /// The audit-event ingest command. /// The actor (the telemetry drain's Ask) the reply routes back to. void IngestAuditEvents(IngestAuditEventsCommand message, IActorRef replyTo); /// Pushes a batch of combined cached-call telemetry; central replies to . /// The cached-telemetry ingest command. /// The actor (the telemetry drain's Ask) the reply routes back to. void IngestCachedTelemetry(IngestCachedTelemetryCommand message, IActorRef replyTo); /// Reports a node's startup inventory; central replies to . /// The reconcile request. /// The actor (the reconciliation Ask) the response routes back to. void ReconcileSite(ReconcileSiteRequest message, IActorRef replyTo); /// Reports periodic site health; central replies to . /// The health report. /// The actor (the health transport's Ask) the ack routes back to. void ReportSiteHealth(SiteHealthReport message, IActorRef replyTo); /// /// Sends an application heartbeat, fire-and-forget. Never replies and never faults; a failure /// is swallowed and logged. /// /// The heartbeat. /// The site communication actor, used as the sender on the Akka path (ignored on gRPC). void SendHeartbeat(HeartbeatMessage message, IActorRef self); }