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 . The production /// implementation is (a gRPC dial of /// CentralControlService with sticky central-a→central-b failover) — the only site→central /// transport since the ClusterClient→gRPC migration removed the Akka path in Phase 4. /// is the fail-loud placeholder used only when the Host injects /// nothing (a wiring bug, and in TestKit suites that only exercise command dispatch). /// /// /// Reply/fault contract. 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 gRPC path sends on any /// non-OK status (a timeout or an Unavailable that could not be failed over) — 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); }