42b00373764ff87a49fdfd4aa803e4e5bf6aa2e8
4 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8a0c59d7e8 |
Java client: port stream-alarms and acknowledge-alarm
Adds the session-less alarm CLI subcommands to the Java CLI. stream-alarms attaches to the gateway's central alarm feed (--filter-prefix, --limit, --json — NDJSON, one AlarmFeedMessage per line); acknowledge-alarm is a unary ack (--reference required, --comment, --operator). streamAlarms joins queryActiveAlarms on MxGatewayClient and uses a new MxGatewayAlarmFeedSubscription cancellable handle. Batch dispatch re-enters the picocli command line per stdin line, so registering the two new subcommands suffices. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
f90bff01db |
Java client: port bulk read/write SDK methods + CLI subcommands
Final language in the bulk-CLI port wave. HEAD's MxGatewaySession had only the subscribe-style bulks; this commit adds the value-bulks plus matching picocli subcommands and a bench-read-bulk harness. SDK (MxGatewaySession.java): - List<BulkWriteResult> writeBulk(int serverHandle, List<WriteBulkEntry> entries) - List<BulkWriteResult> write2Bulk(int serverHandle, List<Write2BulkEntry> entries) - List<BulkWriteResult> writeSecuredBulk(int serverHandle, List<WriteSecuredBulkEntry> entries) - List<BulkWriteResult> writeSecured2Bulk(int serverHandle, List<WriteSecured2BulkEntry> entries) - List<BulkReadResult> readBulk(int serverHandle, List<String> tagAddresses, Duration timeout) readBulk uses java.time.Duration for the timeout parameter (idiomatic Java) and internally converts to the timeoutMs proto field; Duration.ZERO / null both delegate to the worker default. Per-entry secured user ids stay on each WriteSecured(2)BulkEntry to match the proto's per-row shape. CLI (MxGatewayCli.java): - read-bulk / write-bulk / write2-bulk / write-secured-bulk / write-secured2-bulk as picocli @Command subcommands. Write families share value-parsing logic; gating of --current-user-id / --verifier-user-id / --timestamp matches the cross-language flag contract. - bench-read-bulk: --iterations / --warmup loop with avg/min/max ms reporting plus a --json mode that emits the cross-language bench JSON schema. A small fixture in MxGatewayCliTests.FakeSession adds stub implementations of the five new interface methods so the test module compiles. Verification: gradle build BUILD SUCCESSFUL (4 tasks executed, all tests pass); gradle :zb-mom-ww-mxgateway-cli:installDist BUILD SUCCESSFUL. Manual smoke against live gateway on localhost:5120: open-session → register → read-bulk cold (wasCached=false both tags) → subscribe-bulk → read-bulk warm (wasCached=true both tags) → write-bulk int32 111,222 (both wasSuccessful=true) → write2-bulk timestamped (both wasSuccessful=true) → write-secured-bulk and write-secured2-bulk return per-entry MXAccess "Value does not fall within the expected range" failures with the configured user/verifier ids (0,0) — confirming the SDK does NOT throw on per-entry MXAccess failures and surfaces them through BulkWriteResult exactly as the .NET and Go ports do → bench-read-bulk iterations=20 avg=9.5 ms last_success=2/2 cached=2/2 → close-session SESSION_STATE_CLOSED. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
71d2c39f01 |
e2e: port batch subcommand to all five client CLIs
scripts/run-client-e2e-tests.ps1 expects each language CLI to expose a `batch` subcommand that reads command lines from stdin, runs each through the normal subcommand dispatch, writes the JSON result, then a sentinel line `__MXGW_BATCH_EOR__`. The implementation lived on a divergent branch (commit |
||
|
|
397d3c5c4f |
rename: apply ZB.MOM.WW prefix to all client SDKs + fix pre-existing alarm-RPC breaks
Rename across every client surface using each language's idiomatic convention:
* .NET clients/dotnet/MxGateway.Client[.Cli|.Tests]/
-> clients/dotnet/ZB.MOM.WW.MxGateway.Client[.Cli|.Tests]/
namespaces -> ZB.MOM.WW.MxGateway.Client[.Cli|.Tests]
contracts ProjectReference repointed to ZB.MOM.WW.MxGateway.Contracts
sln migrated to slnx (dotnet sln migrate)
* Python src/mxgateway -> src/zb_mom_ww_mxgateway
src/mxgateway_cli -> src/zb_mom_ww_mxgateway_cli
distribution: mxaccess-gateway-client -> zb-mom-ww-mxaccess-gateway-client
* Rust crate: mxgateway-client -> zb-mom-ww-mxgateway-client
build.rs proto path repointed
* Java subprojects: mxgateway-{client,cli} -> zb-mom-ww-mxgateway-{client,cli}
packages com.dohertylan.mxgateway -> com.zb.mom.ww.mxgateway
group com.dohertylan.mxgateway -> com.zb.mom.ww.mxgateway
rootProject mxaccessgw-java -> zb-mom-ww-mxaccessgw-java
* Go generate-proto.ps1 proto path repointed; module path and
package mxgateway kept (Go convention).
* proto-inputs.json: generatedOutputs.python updated to new package path.
* scripts/run-client-e2e-tests.ps1: Java CLI install path + gradle task
updated to zb-mom-ww-mxgateway-cli.
CLI binary names (mxgw, mxgw-py, mxgw-go, mxgateway-cli) and wire-level
identifiers (MXGATEWAY_* env vars, the mxgw_<id>_<secret> API key
prefix, protobuf package names like mxaccess_gateway.v1, all MXAccess
references) intentionally NOT renamed.
Fix pre-existing alarms-over-gateway breaks unblocked by the rename:
* mxaccess_gateway.proto: add missing public message QueryActiveAlarmsRequest
{session_id, client_correlation_id, alarm_filter_prefix} and missing
rpc QueryActiveAlarms(QueryActiveAlarmsRequest) returns
(stream ActiveAlarmSnapshot). All four typed clients referenced
these but they were absent from the proto.
* MxAccessGatewayService.QueryActiveAlarms: implement the new RPC on
the server, streaming from IGatewayAlarmService.CurrentAlarms with
optional alarm_filter_prefix filter.
* clients/dotnet/.../DiscoverHierarchyOptions.cs: add the hand-written
.NET POCO that wraps DiscoverHierarchyRequest (referenced by
GalaxyRepositoryClient.DiscoverHierarchyAsync but never authored).
* Drop retired session_id field references from
AcknowledgeAlarmRequest/AcknowledgeAlarmReply test fixtures across
.NET, Rust, Go, and Python clients.
* Rust integration test: add the missing stream_alarms impl on the
fake MxAccessGateway server (the trait gained the method, fake
didn't).
* Rust CLI test: bump expected gatewayProtocolVersion 2 -> 3.
Regenerated artifacts updated in this commit:
* src/ZB.MOM.WW.MxGateway.Contracts/Generated/{MxaccessGateway,MxaccessGatewayGrpc}.cs
* clients/python/src/zb_mom_ww_mxgateway/generated/*_pb2{,_grpc}.py
* clients/go/internal/generated/*.pb.go
(C# regenerated by Grpc.Tools on contracts build; Python and Go via
their generate-proto.ps1 scripts; Rust regenerates from .proto via
tonic-build at compile time so no checked-in artefact.)
Verification: 472 server tests, 275 worker tests (9 dev-rig skipped),
18 integration tests (live MxAccess + LDAP + Galaxy), 57 .NET client
tests, 32 Rust workspace tests, 39 Python tests, all Go packages, and
gradle build for Java all pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|