Use new addTopic(TopicParameterGroup) method in PAP 75/92275/2
authorjrh3 <jrh3@att.com>
Mon, 29 Jul 2019 16:11:34 +0000 (12:11 -0400)
committerjrh3 <jrh3@att.com>
Tue, 30 Jul 2019 13:27:12 +0000 (09:27 -0400)
Issue-ID: POLICY-1953
Signed-off-by: jrh3 <jrh3@att.com>
Change-Id: I225dc5f03d867efe6167fd20781c9959af34e0e9
Signed-off-by: jrh3 <jrh3@att.com>
main/src/main/java/org/onap/policy/pap/main/startstop/Main.java
main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java
main/src/test/java/org/onap/policy/pap/main/startstop/TestPapActivator.java

index ba73d35..fc3ebbc 100644 (file)
@@ -22,8 +22,6 @@
 package org.onap.policy.pap.main.startstop;
 
 import java.util.Arrays;
-import java.util.Properties;
-import org.onap.policy.common.endpoints.utils.ParameterUtils;
 import org.onap.policy.common.utils.services.Registry;
 import org.onap.policy.pap.main.PapConstants;
 import org.onap.policy.pap.main.PolicyPapException;
@@ -79,9 +77,6 @@ public class Main {
             return;
         }
 
-        // Read the properties
-        Properties props = ParameterUtils.getTopicProperties(parameterGroup.getTopicParameterGroup());
-
         // Initialize database
         try {
             new PapDatabaseInitializer().initializePapDatabase(parameterGroup.getDatabaseProviderParameters());
@@ -91,7 +86,7 @@ public class Main {
         }
 
         // Now, create the activator for the policy pap service
-        activator = new PapActivator(parameterGroup, props);
+        activator = new PapActivator(parameterGroup);
         Registry.register(PapConstants.REG_PAP_ACTIVATOR, activator);
 
         // Start the activator
index a15bc0f..d119044 100644 (file)
@@ -22,7 +22,6 @@
 package org.onap.policy.pap.main.startstop;
 
 import java.util.Arrays;
-import java.util.Properties;
 import java.util.concurrent.atomic.AtomicReference;
 import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
 import org.onap.policy.common.endpoints.event.comm.TopicSource;
@@ -93,13 +92,11 @@ public class PapActivator extends ServiceManagerContainer {
      * Instantiate the activator for policy pap as a complete service.
      *
      * @param papParameterGroup the parameters for the pap service
-     * @param topicProperties properties used to configure the topics
      */
-    public PapActivator(final PapParameterGroup papParameterGroup, final Properties topicProperties) {
+    public PapActivator(final PapParameterGroup papParameterGroup) {
         super("Policy PAP");
 
-        TopicEndpointManager.getManager().addTopicSinks(topicProperties);
-        TopicEndpointManager.getManager().addTopicSources(topicProperties);
+        TopicEndpointManager.getManager().addTopics(papParameterGroup.getTopicParameterGroup());
 
         try {
             this.papParameterGroup = papParameterGroup;
index 2ebd234..13c0609 100644 (file)
@@ -28,12 +28,10 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import java.util.Properties;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
-import org.onap.policy.common.endpoints.utils.ParameterUtils;
 import org.onap.policy.common.utils.services.Registry;
 import org.onap.policy.pap.main.PapConstants;
 import org.onap.policy.pap.main.PolicyPapException;
@@ -67,9 +65,7 @@ public class TestPapActivator {
         final PapCommandLineArguments arguments = new PapCommandLineArguments(papConfigParameters);
         final PapParameterGroup parGroup = new PapParameterHandler().getParameters(arguments);
 
-        Properties props = ParameterUtils.getTopicProperties(parGroup.getTopicParameterGroup());
-
-        activator = new PapActivator(parGroup, props);
+        activator = new PapActivator(parGroup);
     }
 
     /**