driver-galaxy: GalaxyDriver implements IAlarmSource (PR B.2) #413
Reference in New Issue
Block a user
Delete Branch "track-b2-galaxy-driver-ialarmsource"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Twelfth PR of the alarms-over-gateway epic (docs/plans/alarms-over-gateway.md). Depends on PR B.1 (#409, merged) and PR E.2 (mxaccessgw#106, merged). Restores the v1 IAlarmSource capability that PR 7.2 retired with the legacy Galaxy.Host / Galaxy.Proxy projects.
GalaxyDriver gains:
IAlarmSourceon the class declaration → eight capabilities total (IDriver / ITagDiscovery / IReadable / IWritable / ISubscribable / IRediscoverable / IHostConnectivityProbe / IAlarmSource).SubscribeAlarmsAsync— returns a sentinel handle and starts the shared EventPump (alarm wiring is lazy on first sub). Multiple handles share the same gateway stream; the server-side AlarmConditionService dispatches per-source-node downstream.UnsubscribeAlarmsAsync— symmetric handle removal; rejects handles not issued by this driver.AcknowledgeAsync— issues one gateway RPC per acknowledgement throughIGalaxyAlarmAcknowledger. ConditionId carries the alarm full reference; falls back to SourceNodeId when empty.OnAlarmEvent— bridgesEventPump.OnAlarmTransition(B.1) ontoAlarmEventArgs. Suppressed when no alarm subscription is active so untracked transitions don't leak through.New runtime types:
IGalaxyAlarmAcknowledger— test seam.GatewayGalaxyAlarmAcknowledger— production wrapper aroundMxGatewayClient.AcknowledgeAlarmAsync(PR E.2). Maps native MxStatus failures to a logged warning rather than a thrown exception so a transient MxAccess hiccup doesn't fail the operator's Acknowledge.GalaxyAlarmSubscriptionHandle— driver-side IAlarmSubscriptionHandle.Test plan
GalaxyDriverAlarmSourceTests— subscribe → event fire, suppress without subscription, unsubscribe stops flow, foreign-handle rejection, ack routes per-request, ack falls back to SourceNodeId, ack throws NotSupported without acknowledgerDriver.Galaxy.Tests: 203 passed (was 196; 7 new)Stub-ready behaviour
Runtime ack calls will return
PERMISSION_DENIEDuntil A.3 ships the gateway-side dispatch, and no alarm transitions will arrive until A.2 adds the worker MxAccess subscription. Both will activate this code path automatically when the gateway side lands.Follow-up
DriverNodeManagerprefersIAlarmSource.OnAlarmEventover the value-driven sub-attribute fallback when both are available.