summaryrefslogtreecommitdiffstats
path: root/services/services-onappf/src
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-07-30 16:06:49 -0400
committerJim Hahn <jrh3@att.com>2021-08-02 09:42:54 -0400
commit038c19d4042de980d4adccbfa82c1534b53abe5f (patch)
treeda447592a6a90c2d869e34642712edf4413dc6c1 /services/services-onappf/src
parent1036206455218a4722079b749e628ca96825418d (diff)
Use lombok annotations in apex-pdp
Updated projects: services-engine through utilities Issue-ID: POLICY-3391 Change-Id: I35ebb40d86e9bda360f7819516290b3fea88335c Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'services/services-onappf/src')
-rw-r--r--services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterActivator.java14
-rw-r--r--services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterConstants.java11
-rw-r--r--services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterMain.java21
-rw-r--r--services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/comm/PdpStatusPublisher.java12
4 files changed, 19 insertions, 39 deletions
diff --git a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterActivator.java b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterActivator.java
index abd8d4436..7a91c2949 100644
--- a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterActivator.java
+++ b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterActivator.java
@@ -53,7 +53,8 @@ import org.slf4j.LoggerFactory;
public class ApexStarterActivator {
private static final Logger LOGGER = LoggerFactory.getLogger(ApexStarterActivator.class);
- private final ApexStarterParameterGroup apexStarterParameterGroup;
+ @Getter
+ private final ApexStarterParameterGroup parameterGroup;
private List<TopicSink> topicSinks; // topics to which apex-pdp sends pdp status
private List<TopicSource> topicSources; // topics to which apex-pdp listens to for messages from pap.
private static final String[] MSG_TYPE_NAMES = { "messageName" };
@@ -99,7 +100,7 @@ public class ApexStarterActivator {
instanceId = NetworkUtil.genUniqueName("apex");
LOGGER.debug("ApexStarterActivator initializing with instance id: {}", instanceId);
try {
- this.apexStarterParameterGroup = apexStarterParameterGroup;
+ this.parameterGroup = apexStarterParameterGroup;
this.msgDispatcher = new MessageTypeDispatcher(MSG_TYPE_NAMES);
} catch (final RuntimeException e) {
throw new ApexStarterRunTimeException(e);
@@ -205,15 +206,6 @@ public class ApexStarterActivator {
}
/**
- * Get the parameters used by the activator.
- *
- * @return apexStarterParameterGroup the parameters of the activator
- */
- public ApexStarterParameterGroup getParameterGroup() {
- return apexStarterParameterGroup;
- }
-
- /**
* Registers the dispatcher with the topic source(s).
*/
private void registerMsgDispatcher() {
diff --git a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterConstants.java b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterConstants.java
index 2481f4ef7..d00e02ec0 100644
--- a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterConstants.java
+++ b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterConstants.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2021 AT&T Intellectual Property. 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.
@@ -20,10 +21,14 @@
package org.onap.policy.apex.services.onappf;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+
/**
* Names of various items contained in the Registry.
*/
-public class ApexStarterConstants {
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class ApexStarterConstants {
// Registry keys
public static final String REG_APEX_STARTER_ACTIVATOR = "object:activator/apex_starter";
public static final String REG_PDP_STATUS_OBJECT = "object:pdp/status";
@@ -31,8 +36,4 @@ public class ApexStarterConstants {
public static final String REG_PDP_STATUS_PUBLISHER = "object:pdp/status/publisher";
public static final String REG_APEX_PDP_TOPIC_SINKS = "object:apex/pdp/topic/sinks";
public static final String REG_APEX_ENGINE_HANDLER = "object:engine/apex/handler";
-
- private ApexStarterConstants() {
- super();
- }
}
diff --git a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterMain.java b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterMain.java
index c9362bcdd..2976f8260 100644
--- a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterMain.java
+++ b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterMain.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,6 +23,7 @@
package org.onap.policy.apex.services.onappf;
import java.util.Arrays;
+import lombok.Getter;
import org.onap.policy.apex.service.engine.main.ApexPolicyStatisticsManager;
import org.onap.policy.apex.services.onappf.exception.ApexStarterException;
import org.onap.policy.apex.services.onappf.exception.ApexStarterRunTimeException;
@@ -44,7 +45,8 @@ public class ApexStarterMain {
private static final Logger LOGGER = LoggerFactory.getLogger(ApexStarterMain.class);
private ApexStarterActivator activator;
- private ApexStarterParameterGroup parameterGroup;
+ @Getter
+ private ApexStarterParameterGroup parameters;
/**
* Instantiates the ApexStarter.
@@ -68,10 +70,10 @@ public class ApexStarterMain {
arguments.validate();
// Read the parameters
- parameterGroup = new ApexStarterParameterHandler().getParameters(arguments);
+ parameters = new ApexStarterParameterHandler().getParameters(arguments);
// create the activator
- activator = new ApexStarterActivator(parameterGroup);
+ activator = new ApexStarterActivator(parameters);
Registry.register(ApexStarterConstants.REG_APEX_STARTER_ACTIVATOR, activator);
Registry.register(ApexPolicyStatisticsManager.REG_APEX_PDP_POLICY_COUNTER,
new ApexPolicyStatisticsManager());
@@ -92,15 +94,6 @@ public class ApexStarterMain {
LOGGER.info(successMsg);
}
- /**
- * Get the parameters specified in JSON.
- *
- * @return parameterGroup the parameters
- */
- public ApexStarterParameterGroup getParameters() {
- return parameterGroup;
- }
-
/**
* Shut down Execution.
@@ -109,7 +102,7 @@ public class ApexStarterMain {
*/
public void shutdown() throws ApexStarterException {
// clear the parameterGroup variable
- parameterGroup = null;
+ parameters = null;
// clear the apex starter activator
if (activator != null && activator.isAlive()) {
diff --git a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/comm/PdpStatusPublisher.java b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/comm/PdpStatusPublisher.java
index 6c1b6455f..dcd368371 100644
--- a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/comm/PdpStatusPublisher.java
+++ b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/comm/PdpStatusPublisher.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2021 AT&T Intellectual Property. 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.
@@ -23,6 +24,7 @@ package org.onap.policy.apex.services.onappf.comm;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
+import lombok.Getter;
import org.onap.policy.apex.services.onappf.handler.PdpMessageHandler;
import org.onap.policy.common.endpoints.event.comm.TopicSink;
import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
@@ -41,6 +43,7 @@ public class PdpStatusPublisher extends TimerTask {
private TopicSinkClient topicSinkClient;
private Timer timer;
+ @Getter
private long interval;
/**
@@ -72,15 +75,6 @@ public class PdpStatusPublisher extends TimerTask {
}
/**
- * Get the current time interval used by the timer task.
- *
- * @return interval the current time interval
- */
- public long getInterval() {
- return interval;
- }
-
- /**
* Method to send pdp status message to pap on demand.
*
* @param pdpStatus the pdp status