using ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy; using ZB.MOM.WW.MxGateway.Server.Dashboard; namespace ZB.MOM.WW.MxGateway.Server.Galaxy; /// /// Immutable snapshot of the Galaxy Repository browse data held by /// . Multiple gRPC clients share the same /// materialized object list and precomputed dashboard projection. /// public sealed record GalaxyHierarchyCacheEntry( GalaxyCacheStatus Status, long Sequence, DateTimeOffset? LastQueriedAt, DateTimeOffset? LastSuccessAt, DateTimeOffset? LastDeployTime, string? LastError, IReadOnlyList Objects, GalaxyHierarchyIndex Index, DashboardGalaxySummary DashboardSummary, int ObjectCount, int AreaCount, int AttributeCount, int HistorizedAttributeCount, int AlarmAttributeCount) { /// Gets an empty Galaxy hierarchy cache entry. public static GalaxyHierarchyCacheEntry Empty { get; } = new( Status: GalaxyCacheStatus.Unknown, Sequence: 0, LastQueriedAt: null, LastSuccessAt: null, LastDeployTime: null, LastError: null, Objects: Array.Empty(), Index: GalaxyHierarchyIndex.Empty, DashboardSummary: DashboardGalaxySummary.Unknown, ObjectCount: 0, AreaCount: 0, AttributeCount: 0, HistorizedAttributeCount: 0, AlarmAttributeCount: 0); /// Gets a value indicating whether the cache entry contains usable data. public bool HasData => Status is GalaxyCacheStatus.Healthy or GalaxyCacheStatus.Stale; }