Use lombok in pap 62/123162/1
authorRam Krishna Verma <ram_krishna.verma@bell.ca>
Thu, 5 Aug 2021 20:47:47 +0000 (16:47 -0400)
committerRam Krishna Verma <ram_krishna.verma@bell.ca>
Thu, 5 Aug 2021 20:47:54 +0000 (16:47 -0400)
Issue-ID: POLICY-3399
Change-Id: I839f67ff02fdabcb4012a340f7a6a7528dc107e5
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
main/src/main/java/org/onap/policy/pap/main/comm/PdpHeartbeatListener.java
main/src/main/java/org/onap/policy/pap/main/notification/PolicyNotifier.java
main/src/main/java/org/onap/policy/pap/main/rest/StatisticsReport.java

index 027436a..15242a9 100644 (file)
@@ -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<PdpStatus> {
 
     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) {
 
index 24e3ced..641546c 100644 (file)
@@ -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<PolicyNotification> publisher, PolicyModelsProviderFactoryWrapper daoFactory) {
-
-        this.publisher = publisher;
-        this.daoFactory = daoFactory;
-    }
-
     /**
      * Processes a response from a PDP.
      *
index 013cfab..e84d968 100644 (file)
@@ -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;
 }