feat(client-java): add writeArrayElements default-fill helper and document semantics

This commit is contained in:
Joseph Doherty
2026-06-18 03:32:20 -04:00
parent 8a1f037d5a
commit e7b8aa6114
5 changed files with 9640 additions and 436 deletions
+23
View File
@@ -124,6 +124,29 @@ the unchanged elements included. For example, to change 2 elements of a
the 2 new ones). Sending only the 2 changed values overwrites the attribute
with a 2-element array.
When only a few indices need changing and the rest should be reset to the
element type's default, use `writeArrayElements` instead of building the full
array manually:
```java
session.writeArrayElements(
serverHandle, itemHandle,
MxDataType.MX_DATA_TYPE_INTEGER,
20, // totalLength
Map.of(
2, MxValues.int32Value(42),
7, MxValues.int32Value(99)),
userId);
```
The gateway expands the sparse descriptor into a full `totalLength`-element
array before forwarding to the worker. Indices not listed in the map are
written as the element type's default — this is a **reset**, not a preserve;
current values at those positions are discarded. `totalLength` is required and
must match the declared length of the array attribute. Bare-name array items
(`Area001.Pump001.Speed`) are auto-normalized to the `[]` form at `AddItem` so
the array attribute accepts the write.
## Galaxy Repository Browse
The Galaxy Repository service is a separate metadata-only gRPC service exposed