7b0b9c7365
Solution + 23 src projects + 26 test projects renamed; folders, csproj, namespaces, and ScadaLinkDbContext/ScadaBridgeDbContext class updated. ActorSystem "scadalink" → "scadabridge", Akka seed-node URLs migrated. SQL roles/logins, LDAP domains, CLI command name, and CLI config dir (~/.scadalink → ~/.scadabridge) also renamed. Build green; 5 Host.Tests fail awaiting SQL login rename in next commit. Pre-existing StaleTagMonitor timing flakes unchanged. Rename script committed at tools/rename-to-scadabridge.sh.
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using Akka.Actor;
|
|
using ZB.MOM.WW.ScadaBridge.Commons.Messages.Health;
|
|
using ZB.MOM.WW.ScadaBridge.HealthMonitoring;
|
|
using ZB.MOM.WW.ScadaBridge.Host.Actors;
|
|
|
|
namespace ZB.MOM.WW.ScadaBridge.Host;
|
|
|
|
/// <summary>
|
|
/// Sends SiteHealthReport to the local SiteCommunicationActor via Akka ActorSelection.
|
|
/// The SiteCommunicationActor forwards it to central.
|
|
/// </summary>
|
|
public class AkkaHealthReportTransport : IHealthReportTransport
|
|
{
|
|
private readonly AkkaHostedService _akkaService;
|
|
|
|
/// <summary>
|
|
/// Initializes a new <see cref="AkkaHealthReportTransport"/> backed by the given Akka hosted service.
|
|
/// </summary>
|
|
/// <param name="akkaService">The Akka hosted service used to access the running actor system.</param>
|
|
public AkkaHealthReportTransport(AkkaHostedService akkaService)
|
|
{
|
|
_akkaService = akkaService;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public void Send(SiteHealthReport report)
|
|
{
|
|
var actorSystem = _akkaService.ActorSystem;
|
|
if (actorSystem == null) return;
|
|
|
|
var siteComm = actorSystem.ActorSelection("/user/site-communication");
|
|
siteComm.Tell(report, ActorRefs.NoSender);
|
|
}
|
|
}
|