Add summary data model classes#1
Conversation
Introduces JwsInstallation as the root model for a discovered Tomcat installation, along with supporting value objects: JvmInfo, OsInfo, ContainerInfo (with ContainerType enum), and NativeInfo. All models are immutable (builder pattern), null-safe, and annotated for Jackson JSON serialization. Path fields use ToStringSerializer so they render as plain strings in JSON output.
|
@dsoumis PTAL ! |
|
|
||
| private final String aprVersion; | ||
| private final String opensslVersion; | ||
| private final boolean loaded; |
There was a problem hiding this comment.
Should be Boolean so it can be null and excluded by @JsonInclude(NON_NULL).
|
Your design document (Section 5) defines the JSON schema. The implementation should match it. |
|
|
||
| private final String version; | ||
| private final String vendor; | ||
| private final String javaHome; |
| private final OsInfo osInfo; | ||
| private final ContainerInfo containerInfo; | ||
| private final NativeInfo nativeInfo; | ||
| private final Integer pid; |
There was a problem hiding this comment.
"uptime" field from the design doc is missing.
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| public final class JwsInstallation { | ||
|
|
||
| private final Path catalinaHome; |
There was a problem hiding this comment.
"schemaVersion" field from the design doc is missing.
| } | ||
|
|
||
| @JsonSerialize(using = ToStringSerializer.class) | ||
| @JsonProperty("catalinaHome") |
There was a problem hiding this comment.
@JsonProperty("fieldName") annotations are redundant.
| @Override | ||
| public String toString() { | ||
| return "JvmInfo{version='" + version + "', vendor='" + vendor | ||
| + "', javaHome='" + javaHome + "', jvmArgs=" + jvmArgs + '}'; |
There was a problem hiding this comment.
Your design doc has a "No secrets in output" security constraint. The jvmArgs list stores values as-is with no redaction. It can contain secrets like -Djavax.net.ssl.keyStorePassword=secret. Make sure the detector that populates this field applies redaction before passing the list to the builder.
|
Following CONTRIBUTING.md guidelines you should include tests for this PR. |
|
The JSON output still doesn't match the schema the design doc describes. |
| } | ||
|
|
||
| @Test | ||
| void jvmArgsListIsImmutable() { |
There was a problem hiding this comment.
doesn't actually verify immutability
Description:
Introduces the root data model for a discovered JBoss Web Server / Apache Tomcat installation. These classes are the foundation that the discovery pipeline (Week 1-2) will populate and the summary formatter (Week 3) will consume.
Classes added in summary/model/:
Class and Purpose
Design decisions:
To test:
All 7 existing tests pass. No new tests in this commit discovery unit tests follow in the next PR.