Files
ScadaBridge/src/ZB.MOM.WW.ScadaBridge.HealthMonitoring/IClusterNodeProvider.cs
T

26 lines
1.2 KiB
C#

using ZB.MOM.WW.ScadaBridge.Commons.Messages.Health;
namespace ZB.MOM.WW.ScadaBridge.HealthMonitoring;
/// <summary>
/// Provides cluster node status information for health reporting.
/// Implemented by the Host project which has access to the Akka.NET actor system.
/// </summary>
public interface IClusterNodeProvider
{
/// <summary>Returns the current status of all cluster nodes for the provider's role scope.</summary>
/// <returns>A read-only list of node status records for all known cluster nodes.</returns>
IReadOnlyList<NodeStatus> GetClusterNodes();
/// <summary>
/// True when this node is currently the oldest Up member for the provider's
/// role scope — the node the ClusterSingletonManager hosts singletons on.
/// This is the canonical product "active node" check (review 01): the site
/// event-log purge gate, the central self-report loop, and (via plan 02) the
/// S&amp;F delivery gate all consume it. It is deliberately NOT the cluster
/// leader — leadership is address-ordered and diverges from singleton
/// placement once the original first node restarts and rejoins.
/// </summary>
bool SelfIsPrimary { get; }
}