clients/java: SDK methods for AcknowledgeAlarm + QueryActiveAlarms (PR E.5) #109

Merged
dohertj2 merged 1 commits from track-e5-java-alarm-sdk into main 2026-04-30 17:04:04 -04:00
Owner

Summary

Tenth PR of the alarms-over-gateway epic (docs/plans/alarms-over-gateway.md). Mirrors PR E.2's .NET surface on the Java SDK. Depends on PR E.1 (#105, merged).

  • MxGatewayClient.acknowledgeAlarm — blocking unary call, validates protocol status via the existing MxGatewayErrors helper. Wraps RuntimeException through MxGatewayErrors.fromGrpc for typed failure mapping.
  • MxGatewayClient.acknowledgeAlarmAsync — CompletableFuture variant using the future stub.
  • MxGatewayClient.queryActiveAlarms — async server-streaming RPC observed via a new MxGatewayActiveAlarmsSubscription handle (parallel to MxGatewayEventSubscription; the existing subscription class is hard-typed to MxEvent so a parallel type was simpler than retrofitting generics).
  • MxGatewayClientVersion bumps GATEWAY_PROTOCOL_VERSION 2 → 3 to match the .NET contract; CLI version-string assertions updated.

Test plan

  • Java SDK build green via Gradle 9.4.1 (mxgateway-client + mxgateway-cli)
  • 17 actionable tasks, all tests passing
  • CLI version assertions pinned to bumped protocol version

Dedicated AlarmsApiTest tests (synthetic stub gRPC server) deferred to a follow-up — the Java SDK pattern relies on Gradle protobuf-plugin codegen rather than hand-written fakes; protocol coverage already lands via the regenerated proto types and the existing MxGatewayClientTests integration scaffolding.

## Summary Tenth PR of the **alarms-over-gateway** epic (docs/plans/alarms-over-gateway.md). Mirrors PR E.2's .NET surface on the Java SDK. Depends on PR E.1 (#105, merged). - `MxGatewayClient.acknowledgeAlarm` — blocking unary call, validates protocol status via the existing `MxGatewayErrors` helper. Wraps `RuntimeException` through `MxGatewayErrors.fromGrpc` for typed failure mapping. - `MxGatewayClient.acknowledgeAlarmAsync` — CompletableFuture variant using the future stub. - `MxGatewayClient.queryActiveAlarms` — async server-streaming RPC observed via a new `MxGatewayActiveAlarmsSubscription` handle (parallel to `MxGatewayEventSubscription`; the existing subscription class is hard-typed to `MxEvent` so a parallel type was simpler than retrofitting generics). - `MxGatewayClientVersion` bumps `GATEWAY_PROTOCOL_VERSION` 2 → 3 to match the .NET contract; CLI version-string assertions updated. ## Test plan - [x] Java SDK build green via Gradle 9.4.1 (`mxgateway-client` + `mxgateway-cli`) - [x] 17 actionable tasks, all tests passing - [x] CLI version assertions pinned to bumped protocol version Dedicated `AlarmsApiTest` tests (synthetic stub gRPC server) deferred to a follow-up — the Java SDK pattern relies on Gradle protobuf-plugin codegen rather than hand-written fakes; protocol coverage already lands via the regenerated proto types and the existing `MxGatewayClientTests` integration scaffolding.
dohertj2 added 1 commit 2026-04-30 17:04:01 -04:00
Tenth PR of the alarms-over-gateway epic
(docs/plans/alarms-over-gateway.md). Mirrors PR E.2's .NET surface
on the Java SDK. Depends on PR E.1 (regen, merged).

- MxGatewayClient.acknowledgeAlarm — blocking unary call, validates
  protocol status via the existing MxGatewayErrors helper. Wraps
  RuntimeException through MxGatewayErrors.fromGrpc for typed
  failure mapping.
- MxGatewayClient.acknowledgeAlarmAsync — CompletableFuture variant
  using the future stub.
- MxGatewayClient.queryActiveAlarms — async server-streaming RPC
  observed via a new MxGatewayActiveAlarmsSubscription handle
  (parallel to MxGatewayEventSubscription; the existing
  subscription class is hard-typed to MxEvent so a parallel type
  was simpler than retrofitting generics).
- MxGatewayClientVersion bumps GATEWAY_PROTOCOL_VERSION 2 → 3 to
  match the .NET contract; CLI version-string assertions updated
  to match.

Java SDK build green via Gradle 9.4.1 (mxgateway-client + mxgateway-cli).
17 tasks, all tests passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dohertj2 merged commit d0bc78cd43 into main 2026-04-30 17:04:04 -04:00
dohertj2 deleted branch track-e5-java-alarm-sdk 2026-04-30 17:04:04 -04:00
Sign in to join this conversation.