From 176de86fcec998b378510b9f2a48e7be67023dad Mon Sep 17 00:00:00 2001 From: Ram Krishna Verma Date: Thu, 5 Aug 2021 16:47:47 -0400 Subject: Use lombok in pap Issue-ID: POLICY-3399 Change-Id: I839f67ff02fdabcb4012a340f7a6a7528dc107e5 Signed-off-by: Ram Krishna Verma --- .../policy/pap/main/comm/PdpHeartbeatListener.java | 12 ++---------- .../policy/pap/main/notification/PolicyNotifier.java | 15 ++------------- .../onap/policy/pap/main/rest/StatisticsReport.java | 20 ++------------------ 3 files changed, 6 insertions(+), 41 deletions(-) diff --git a/main/src/main/java/org/onap/policy/pap/main/comm/PdpHeartbeatListener.java b/main/src/main/java/org/onap/policy/pap/main/comm/PdpHeartbeatListener.java index 027436a4..15242a92 100644 --- a/main/src/main/java/org/onap/policy/pap/main/comm/PdpHeartbeatListener.java +++ b/main/src/main/java/org/onap/policy/pap/main/comm/PdpHeartbeatListener.java @@ -22,6 +22,7 @@ package org.onap.policy.pap.main.comm; +import lombok.AllArgsConstructor; import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; import org.onap.policy.common.endpoints.listeners.TypedMessageListener; import org.onap.policy.models.pdp.concepts.PdpStatus; @@ -32,22 +33,13 @@ import org.onap.policy.pap.main.parameters.PdpParameters; * * @author Ram Krishna Verma (ram.krishna.verma@est.tech) */ +@AllArgsConstructor public class PdpHeartbeatListener implements TypedMessageListener { private final PdpParameters params; private final boolean savePdpStatistics; - /** - * Constructs the object. - * - * @param params PDP parameters - */ - public PdpHeartbeatListener(PdpParameters params, boolean savePdpStatistics) { - this.params = params; - this.savePdpStatistics = savePdpStatistics; - } - @Override public void onTopicEvent(final CommInfrastructure infra, final String topic, final PdpStatus message) { diff --git a/main/src/main/java/org/onap/policy/pap/main/notification/PolicyNotifier.java b/main/src/main/java/org/onap/policy/pap/main/notification/PolicyNotifier.java index 24e3ced6..641546c1 100644 --- a/main/src/main/java/org/onap/policy/pap/main/notification/PolicyNotifier.java +++ b/main/src/main/java/org/onap/policy/pap/main/notification/PolicyNotifier.java @@ -22,6 +22,7 @@ package org.onap.policy.pap.main.notification; import java.util.Set; +import lombok.AllArgsConstructor; import org.onap.policy.models.base.PfModelException; import org.onap.policy.models.pap.concepts.PolicyNotification; import org.onap.policy.models.provider.PolicyModelsProvider; @@ -35,6 +36,7 @@ import org.slf4j.LoggerFactory; /** * Notifier for completion of policy updates. */ +@AllArgsConstructor public class PolicyNotifier { private static final Logger logger = LoggerFactory.getLogger(PolicyNotifier.class); @@ -45,19 +47,6 @@ public class PolicyNotifier { private final PolicyModelsProviderFactoryWrapper daoFactory; - - /** - * Constructs the object. Loads all deployed policies into the internal cache. - * - * @param publisher notification publisher - * @param daoFactory factory used to load policy deployment data from the DB - */ - public PolicyNotifier(Publisher publisher, PolicyModelsProviderFactoryWrapper daoFactory) { - - this.publisher = publisher; - this.daoFactory = daoFactory; - } - /** * Processes a response from a PDP. * diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/StatisticsReport.java b/main/src/main/java/org/onap/policy/pap/main/rest/StatisticsReport.java index 013cfab6..e84d9684 100644 --- a/main/src/main/java/org/onap/policy/pap/main/rest/StatisticsReport.java +++ b/main/src/main/java/org/onap/policy/pap/main/rest/StatisticsReport.java @@ -29,34 +29,18 @@ import lombok.ToString; * * @author Ram Krishna Verma (ram.krishna.verma@est.tech) */ +@Getter +@Setter @ToString public class StatisticsReport { - @Getter - @Setter private int code; - @Getter - @Setter private long totalPdpCount; - @Getter - @Setter private long totalPdpGroupCount; - @Getter - @Setter private long totalPolicyDeployCount; - @Getter - @Setter private long policyDeploySuccessCount; - @Getter - @Setter private long policyDeployFailureCount; - @Getter - @Setter private long totalPolicyDownloadCount; - @Getter - @Setter private long policyDownloadSuccessCount; - @Getter - @Setter private long policyDownloadFailureCount; } -- cgit 1.2.3-korg