Typed WQL results: map CIM values to Java objects instead of strings
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Java
- Star
- 13
- Fork
- 4
- Merge trung bình
- 12 giờ 44 phút
- Pull request đã merge (30 ngày)
- 17
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MetricsHub/winrm-java
-
bug documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
MetricsHub/winrm-java#202 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
WQL array properties: add the trailing separator to match wmi-javaCó thể đã có người làm @bertysentry đã nhận hôm nay. Đang mởenhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
MetricsHub/winrm-java#201 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
MetricsHub/winrm-java#199 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
MetricsHub/winrm-java#176 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của MetricsHub/winrm-java
Issue tương tự
-
`Processing lsp` never exits and leaves orphaned processesCó thể đã có người làm @overcast302 đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
processing/processing4#1578 · 1 bình luận ·
-
ASM is not up-to-dateĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 60/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] S3 CORS responses omit Access-Control-Allow-Credentials for matched originsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
floci-io/floci#5369 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
securityHeaders replaces a route's own Content-Security-Policy (0.9.9; weakens embedders' pages)Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
sqlcipher/sqlcipher-android#97 · 1 bình luận ·