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/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;
- }
}
}