aboutsummaryrefslogtreecommitdiffstats
path: root/gui-pdp-monitoring/src/main
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-07-16 10:04:54 -0400
committerJim Hahn <jrh3@att.com>2021-07-16 10:05:16 -0400
commitefaa2f3f7d22a5096625b51643f707b471569d78 (patch)
tree58f44f24cb34842ebb1a2b30a126894b71a5c5b3 /gui-pdp-monitoring/src/main
parent71d6358a8f787c5d2688a485d42ff9514dc58a56 (diff)
Use lombok annotations in gui
Issue-ID: POLICY-3395 Change-Id: I7820877522875a3caf47e3b7409eb4f7fb15ba2b Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'gui-pdp-monitoring/src/main')
-rw-r--r--gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/PdpMonitoringMain.java15
-rw-r--r--gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/rest/PdpMonitoringRestResource.java12
2 files changed, 4 insertions, 23 deletions
diff --git a/gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/PdpMonitoringMain.java b/gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/PdpMonitoringMain.java
index 385e2b5..398cbc4 100644
--- a/gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/PdpMonitoringMain.java
+++ b/gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/PdpMonitoringMain.java
@@ -105,7 +105,7 @@ public class PdpMonitoringMain {
pdpMonitoringServer = new PdpMonitoringServer(parameters);
// Add a shutdown hook to shut down the servlet services when the process is exiting
- Runtime.getRuntime().addShutdownHook(new Thread(new PdpServicesShutdownHook()));
+ Runtime.getRuntime().addShutdownHook(new Thread(this::shutdown));
state = ServicesState.RUNNING;
@@ -160,19 +160,6 @@ public class PdpMonitoringMain {
}
/**
- * This class is a shutdown hook for the Pdp services command.
- */
- private class PdpServicesShutdownHook implements Runnable {
- /**
- * {@inheritDoc}.
- */
- @Override
- public void run() {
- shutdown();
- }
- }
-
- /**
* Main method, main entry point for command.
*
* @param args The command line arguments for the GUI
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 ede9bee..6075049 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
@@ -38,6 +38,7 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
@@ -243,15 +244,12 @@ public class PdpMonitoringRestResource {
* A list of values that uses a FIFO sliding window of a fixed size.
*/
@EqualsAndHashCode(callSuper = true)
+ @AllArgsConstructor
public class SlidingWindowList<V> extends LinkedList<V> {
private static final long serialVersionUID = -7187277916025957447L;
private final int maxEntries;
- public SlidingWindowList(final int maxEntries) {
- this.maxEntries = maxEntries;
- }
-
@Override
public boolean add(final V elm) {
if (this.size() > (maxEntries - 1)) {
@@ -265,14 +263,10 @@ public class PdpMonitoringRestResource {
* A class used to storing a single data entry for an engine.
*/
@Getter
+ @AllArgsConstructor
public class Counter {
private final long timestamp;
private final long value;
-
- public Counter(final long timestamp, final long value) {
- this.timestamp = timestamp;
- this.value = value;
- }
}
}