22
22
import static org .jboss .as .controller .operations .global .GlobalInstallationReportHandler .JVM_VENDOR ;
23
23
import static org .jboss .as .controller .operations .global .GlobalInstallationReportHandler .JVM_VERSION ;
24
24
import static org .jboss .as .controller .operations .global .GlobalInstallationReportHandler .OS ;
25
+ import static org .jboss .as .controller .operations .global .GlobalInstallationReportHandler .PRODUCT_CHANNEL_VERSIONS ;
25
26
import static org .jboss .as .controller .operations .global .GlobalInstallationReportHandler .PRODUCT_TYPE ;
26
27
import static org .jboss .as .controller .operations .global .GlobalInstallationReportHandler .PRODUCT_COMMUNITY_IDENTIFIER ;
27
28
import static org .jboss .as .controller .operations .global .GlobalInstallationReportHandler .PRODUCT_HOME ;
39
40
import java .util .List ;
40
41
import java .util .Locale ;
41
42
import java .util .Properties ;
43
+
42
44
import org .jboss .as .controller .OperationContext ;
43
45
import org .jboss .as .controller .OperationFailedException ;
44
46
import org .jboss .as .controller .OperationStepHandler ;
@@ -174,6 +176,10 @@ protected ModelNode createProductNode(OperationContext context, InstallationConf
174
176
product .get (OS ).set (createOSNode ());
175
177
product .get (CPU ).set (createCPUNode ());
176
178
product .get (JVM ).set (createJVMNode ());
179
+ List <ModelNode > channelVersions = installation .getChannelVersions ();
180
+ if (channelVersions != null && !channelVersions .isEmpty ()) {
181
+ product .get (PRODUCT_CHANNEL_VERSIONS ).set (channelVersions );
182
+ }
177
183
return product ;
178
184
}
179
185
@@ -275,18 +281,18 @@ protected static final class InstallationConfiguration {
275
281
276
282
private final ProcessEnvironment environment ;
277
283
private final ProductConfig config ;
278
- private final ModelNode patchingInfo ;
284
+ private final ModelNode installerInfo ;
279
285
private final Path installationDir ;
280
286
281
- public InstallationConfiguration (ProcessEnvironment environment , ProductConfig config , ModelNode patchingInfo , Path installationDir ) {
287
+ public InstallationConfiguration (ProcessEnvironment environment , ProductConfig config , ModelNode installerInfo , Path installationDir ) {
282
288
assert environment != null ;
283
289
assert config != null ;
284
- assert patchingInfo != null ;
290
+ assert installerInfo != null ;
285
291
assert installationDir != null ;
286
292
287
293
this .environment = environment ;
288
294
this .config = config ;
289
- this .patchingInfo = patchingInfo ;
295
+ this .installerInfo = installerInfo ;
290
296
this .installationDir = installationDir ;
291
297
}
292
298
@@ -310,11 +316,23 @@ String getInstallationDir() {
310
316
}
311
317
312
318
String getLastUpdateDate () {
313
- if (patchingInfo .isDefined ()) {
314
- List <ModelNode > result = Operations .readResult (patchingInfo ).asList ();
315
- for (ModelNode patchAtt : result ) {
316
- if (patchAtt .has ("applied-at" )) {
317
- return patchAtt .get ("applied-at" ).asString ();
319
+ if (installerInfo .get ("result" ).isDefined ()) {
320
+ List <ModelNode > result = Operations .readResult (installerInfo ).asList ();
321
+ for (ModelNode installerAtt : result ) {
322
+ if (installerAtt .has ("timestamp" )) {
323
+ return installerAtt .get ("timestamp" ).asString ();
324
+ }
325
+ }
326
+ }
327
+ return null ;
328
+ }
329
+
330
+ List <ModelNode > getChannelVersions () {
331
+ if (installerInfo .get ("result" ).isDefined ()) {
332
+ List <ModelNode > result = Operations .readResult (installerInfo ).asList ();
333
+ for (ModelNode installerAtt : result ) {
334
+ if (installerAtt .has ("channel-versions" )) {
335
+ return installerAtt .get ("channel-versions" ).asList ();
318
336
}
319
337
}
320
338
}
0 commit comments