aboutsummaryrefslogtreecommitdiffstats
path: root/gui-pdp-monitoring
diff options
context:
space:
mode:
Diffstat (limited to 'gui-pdp-monitoring')
-rw-r--r--gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/PdpMonitoringServerParameterParser.java3
-rw-r--r--gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/rest/PdpMonitoringRestResource.java8
2 files changed, 6 insertions, 5 deletions
diff --git a/gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/PdpMonitoringServerParameterParser.java b/gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/PdpMonitoringServerParameterParser.java
index 76fa005..7846b0e 100644
--- a/gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/PdpMonitoringServerParameterParser.java
+++ b/gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/PdpMonitoringServerParameterParser.java
@@ -2,6 +2,7 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2020 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -106,7 +107,7 @@ public class PdpMonitoringServerParameterParser {
final var stringWriter = new StringWriter();
final var stringPrintWriter = new PrintWriter(stringWriter);
- final HelpFormatter helpFormatter = new HelpFormatter();
+ final var helpFormatter = new HelpFormatter();
helpFormatter.printHelp(stringPrintWriter, 120, mainClassName + " [options...] ", "", options, 0, 0, "");
return stringWriter.toString();
diff --git a/gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/rest/PdpMonitoringRestResource.java b/gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/rest/PdpMonitoringRestResource.java
index 419fe04..ede9bee 100644
--- a/gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/rest/PdpMonitoringRestResource.java
+++ b/gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/rest/PdpMonitoringRestResource.java
@@ -2,6 +2,7 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2020-2021 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -45,7 +46,6 @@ import org.onap.policy.common.endpoints.http.client.HttpClientConfigException;
import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
-import org.onap.policy.models.pdp.concepts.Pdp;
import org.onap.policy.models.pdp.concepts.PdpEngineWorkerStatistics;
import org.onap.policy.models.pdp.concepts.PdpGroups;
import org.onap.policy.models.pdp.concepts.PdpStatistics;
@@ -134,7 +134,7 @@ public class PdpMonitoringRestResource {
throw new IllegalArgumentException("Cannot parse groupName, subGroup and instanceId from " + id);
}
- Pdp pdp = pdpGroups.getGroups().stream().filter(group -> group.getName().equals(groupName))
+ var pdp = pdpGroups.getGroups().stream().filter(group -> group.getName().equals(groupName))
.flatMap(group -> group.getPdpSubgroups().stream().filter(sub -> sub.getPdpType().equals(subGroup)))
.flatMap(sub -> sub.getPdpInstances().stream()
.filter(instance -> instance.getInstanceId().equals(instanceId)))
@@ -157,7 +157,7 @@ public class PdpMonitoringRestResource {
final List<EngineStatus> engineStatusList = new ArrayList<>();
if (!pdpStats.isEmpty()) {
- PdpStatistics pdpStatistics = pdpStats.get(groupName).get(subGroup).get(0);
+ var pdpStatistics = pdpStats.get(groupName).get(subGroup).get(0);
responseObject.setTimeStamp(pdpStatistics.getTimeStamp().toString());
responseObject.setPolicyDeployCount(pdpStatistics.getPolicyDeployCount());
responseObject.setPolicyDeploySuccessCount(pdpStatistics.getPolicyDeploySuccessCount());
@@ -169,7 +169,7 @@ public class PdpMonitoringRestResource {
// Engine Status data
for (final PdpEngineWorkerStatistics engineStats : pdpStatistics.getEngineStats()) {
try {
- final EngineStatus engineStatusObject = new EngineStatus();
+ final var engineStatusObject = new EngineStatus();
engineStatusObject.setTimestamp(pdpStatistics.getTimeStamp().toString());
engineStatusObject.setId(engineStats.getEngineId());
engineStatusObject.setStatus(engineStats.getEngineWorkerState().name());