diff options
author | Jorge Hernandez <jorge.hernandez-herrero@att.com> | 2019-07-31 14:34:22 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-07-31 14:34:22 +0000 |
commit | 82b8462606d9eb369a4434f043b5555cefe21b43 (patch) | |
tree | 0423d193ac6a21e0dd468f09cd09224d77b7f6eb /main | |
parent | 7e16e47913b0a76acc20788450ca7efdda6cc92e (diff) | |
parent | 535b68b4ea437547639a8f662766bcaa9c6fabe8 (diff) |
Merge "Use new addTopic() method in xacml-pdp"
Diffstat (limited to 'main')
3 files changed, 5 insertions, 18 deletions
diff --git a/main/src/main/java/org/onap/policy/pdpx/main/startstop/Main.java b/main/src/main/java/org/onap/policy/pdpx/main/startstop/Main.java index 62b811d8..8d3aa9ff 100644 --- a/main/src/main/java/org/onap/policy/pdpx/main/startstop/Main.java +++ b/main/src/main/java/org/onap/policy/pdpx/main/startstop/Main.java @@ -22,9 +22,7 @@ package org.onap.policy.pdpx.main.startstop; import java.util.Arrays; -import java.util.Properties; import lombok.Getter; -import org.onap.policy.common.endpoints.utils.ParameterUtils; import org.onap.policy.pdpx.main.PolicyXacmlPdpException; import org.onap.policy.pdpx.main.parameters.XacmlPdpParameterGroup; import org.onap.policy.pdpx.main.parameters.XacmlPdpParameterHandler; @@ -71,11 +69,8 @@ public class Main { // Read the parameters XacmlPdpParameterGroup parameterGroup = new XacmlPdpParameterHandler().getParameters(arguments); - // Read the properties - Properties props = ParameterUtils.getTopicProperties(parameterGroup.getTopicParameterGroup()); - // Now, create the activator for the policy xacml pdp service - activator = new XacmlPdpActivator(parameterGroup, props); + activator = new XacmlPdpActivator(parameterGroup); XacmlPdpActivator.setCurrent(activator); // Start the activator diff --git a/main/src/main/java/org/onap/policy/pdpx/main/startstop/XacmlPdpActivator.java b/main/src/main/java/org/onap/policy/pdpx/main/startstop/XacmlPdpActivator.java index 70253c09..16998a22 100644 --- a/main/src/main/java/org/onap/policy/pdpx/main/startstop/XacmlPdpActivator.java +++ b/main/src/main/java/org/onap/policy/pdpx/main/startstop/XacmlPdpActivator.java @@ -22,7 +22,6 @@ package org.onap.policy.pdpx.main.startstop; import java.nio.file.Paths; import java.util.Arrays; -import java.util.Properties; import lombok.Getter; import lombok.Setter; import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager; @@ -77,13 +76,11 @@ public class XacmlPdpActivator extends ServiceManagerContainer { * Instantiate the activator for policy xacml pdp as a complete service. * * @param xacmlPdpParameterGroup the parameters for the xacml pdp service - * @param topicProperties properties used to configure the topics */ - public XacmlPdpActivator(final XacmlPdpParameterGroup xacmlPdpParameterGroup, Properties topicProperties) { - LOGGER.info("Activator initializing using {} and {}", xacmlPdpParameterGroup, topicProperties); + public XacmlPdpActivator(final XacmlPdpParameterGroup xacmlPdpParameterGroup) { + LOGGER.info("Activator initializing using {}", xacmlPdpParameterGroup); - TopicEndpointManager.getManager().addTopicSinks(topicProperties); - TopicEndpointManager.getManager().addTopicSources(topicProperties); + TopicEndpointManager.getManager().addTopics(xacmlPdpParameterGroup.getTopicParameterGroup()); final XacmlPdpHearbeatPublisher heartbeat; final TopicSinkClient sinkClient; diff --git a/main/src/test/java/org/onap/policy/pdpx/main/startstop/TestXacmlPdpActivator.java b/main/src/test/java/org/onap/policy/pdpx/main/startstop/TestXacmlPdpActivator.java index 7e7dee22..cd4b78d9 100644 --- a/main/src/test/java/org/onap/policy/pdpx/main/startstop/TestXacmlPdpActivator.java +++ b/main/src/test/java/org/onap/policy/pdpx/main/startstop/TestXacmlPdpActivator.java @@ -26,12 +26,10 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; -import java.util.Properties; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import org.onap.policy.common.endpoints.utils.ParameterUtils; import org.onap.policy.pdpx.main.CommonRest; import org.onap.policy.pdpx.main.PolicyXacmlPdpException; import org.onap.policy.pdpx.main.parameters.CommonTestData; @@ -45,7 +43,6 @@ import org.onap.policy.pdpx.main.parameters.XacmlPdpParameterHandler; */ public class TestXacmlPdpActivator extends CommonRest { private static XacmlPdpParameterGroup parGroup; - private static Properties props; private XacmlPdpActivator activator = null; @@ -60,8 +57,6 @@ public class TestXacmlPdpActivator extends CommonRest { final XacmlPdpCommandLineArguments arguments = new XacmlPdpCommandLineArguments(xacmlPdpConfigParameters); parGroup = new XacmlPdpParameterHandler().getParameters(arguments); - props = ParameterUtils.getTopicProperties(parGroup.getTopicParameterGroup()); - // don't want the common "main" running CommonRest.stopMain(); } @@ -71,7 +66,7 @@ public class TestXacmlPdpActivator extends CommonRest { */ @Before public void setUp() { - activator = new XacmlPdpActivator(parGroup, props); + activator = new XacmlPdpActivator(parGroup); } @Test |