summaryrefslogtreecommitdiffstats
path: root/services/services-onappf
diff options
context:
space:
mode:
Diffstat (limited to 'services/services-onappf')
-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