Typed WQL results: map CIM values to Java objects instead of strings
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 30/100
Rechercherichtung
Start by tracing WqlRow.get(String), the WQL query execution path, and the legacy WinRMWqlExecutor.getRows() and WindowsRemoteExecutor.executeWql APIs. Review how WS-Management exposes CIM class and value information before deciding the typed opt-in shape. Done means a defined mapping for scalar, array, datetime, embedded, and NULL values while preserving the existing string API; the issue does not name tests or implementation files.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Follow-up to #189 (PR #193), where WMI array properties were fixed to come back as a single string joined with | (configurable with WinRMClient.Builder.arraySeparator(String)).
Problem
Every WQL value is exposed as a String, whatever its CIM type. Consumers parse numbers, booleans, dates and now |-joined arrays themselves:
WqlRow.get(String)is declaredObjectbut always returns aString.- An array property is a joined string: a single-element array is indistinguishable from a scalar, and an element that contains the separator is ambiguous.
NULLis an empty string, indistinguishable from an empty string value.- CIM datetimes arrive in the WS-Management form (
<cim:Datetime>2024-05-01T12:34:56.789Z</cim:Datetime>forCIM_DATETIMEvalues, or an interval), which nobody wants to parse by hand.
Proposal
A typed result variant where the row values are native Java objects, alongside the existing string-based API (which stays the default, and the only one for the legacy WinRMWqlExecutor.getRows() / List<List<String>>).
Suggested shape, to be refined:
- Opt in per query, e.g.
client.wql(query).typed().execute(), or aWqlRow.typed(String)/WqlRow.list(String)accessor family; the legacyList<Map<String, Object>>ofWindowsRemoteExecutor.executeWqlcould also carry typed values under an opt-in flag, soWinRMWqlExecutorkeeps its strings. - Mapping from the type information WS-Management gives us. The instance XML carries no
xsi:type; the CIM type must come from the class schema (a WSManGetof the class definition,winrm get wmi/...?__CLASS, or thep:XML schema), or from the value form (<cim:Datetime>wrapper,xsi:nil, repeated elements).
Suggested mapping:
| CIM type | Java |
|---|---|
string, char16 |
String |
boolean |
Boolean |
sint8/sint16/sint32/sint64, uint8/uint16/uint32 |
Integer / Long (uint64 → BigInteger or Long) |
real32/real64 |
Float / Double |
datetime |
java.time.Instant / OffsetDateTime for timestamps, Duration for intervals |
reference |
String (the object path) |
| embedded object | nested WqlRow |
| array of any of the above | List<T> |
NULL (xsi:nil="true") |
null |
Open questions
- Where the CIM type information comes from without an extra round trip per query (cache the class schema per client and class?).
- Whether the WS-Management datetime encoding is consistent across Windows versions (2008 R2 through 2022 are available as test hosts).
- Whether the CLI should emit JSON arrays/numbers/booleans/null when typed values are available (today it emits strings only).
Not in scope
The string API stays as it is: the | join and the empty-string NULL are documented behavior since 2.3.00.
- Vorherrschende Sprache
- Java
- Sterne
- 13
- Forks
- 4
- Ø Merge
- 7 Std. 38 Min.
- Gemergte PRs (30 T.)
- 14
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus MetricsHub/winrm-java
-
bug documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
MetricsHub/winrm-java#202 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 58/100
MetricsHub/winrm-java#201 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 78/100
MetricsHub/winrm-java#199 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Streaming command fails with a spurious timeout when reconnecting after an idle pauseEvtl. vergeben @NassimBtk hat das vor 1 Tag übernommen. Offen
MetricsHub/winrm-java#198 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Long-lived `WinRMClient` keeps failing with WSManFault 2150859174 after a terminate Signal failsEvtl. vergeben @NassimBtk hat das heute übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 25/100
MetricsHub/winrm-java#196 · 4 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in MetricsHub/winrm-java
Ähnliche Issues
-
[Bug] AI unread message badge counts a batch of new bubbles as one messageEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
apache/rocketmq-dashboard#5784 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
PCL-Community/PCL-CE#3658 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
apache/skywalking#14127 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
Team/Identity Server Core Type/Improvement U2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
wso2/product-is#28553 ·
Maintainer antworten meist innerhalb von 1 Tag