aboutsummaryrefslogtreecommitdiffstats
path: root/models-sim/policy-models-sim-pdp/src/main/java
diff options
context:
space:
mode:
authora.sreekumar <ajith.sreekumar@est.tech>2019-07-05 13:00:35 +0000
committera.sreekumar <ajith.sreekumar@est.tech>2019-07-05 13:00:35 +0000
commitc5231f939d724dd59cb385d8521924a1bff19cee (patch)
treebed6d13d5986b0cd5f3b8d0fcea8b7010d951340 /models-sim/policy-models-sim-pdp/src/main/java
parentb359a4b56b4527b3215b89e7d637da9fbcb022af (diff)
Remove topic.properties and incorporate into overall config file for pdp-simulator
Change-Id: Iac882c7ffb28a80ef474d15a90307cd68b78d417 Issue-ID: POLICY-1744 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
Diffstat (limited to 'models-sim/policy-models-sim-pdp/src/main/java')
-rw-r--r--models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorCommandLineArguments.java1
-rw-r--r--models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorMain.java13
-rw-r--r--models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/parameters/PdpSimulatorParameterGroup.java3
3 files changed, 4 insertions, 13 deletions
diff --git a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorCommandLineArguments.java b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorCommandLineArguments.java
index 50d2bd2ad..8eff1af42 100644
--- a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorCommandLineArguments.java
+++ b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorCommandLineArguments.java
@@ -165,7 +165,6 @@ public class PdpSimulatorCommandLineArguments {
*/
public void validate() throws PdpSimulatorException {
validateReadableFile("pdp simulator configuration", configurationFilePath);
- validateReadableFile("pdp simulator properties", propertyFilePath);
}
/**
diff --git a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorMain.java b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorMain.java
index 78330135a..ee974c579 100644
--- a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorMain.java
+++ b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorMain.java
@@ -21,9 +21,9 @@
package org.onap.policy.models.sim.pdp;
-import java.io.FileInputStream;
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.models.sim.pdp.exception.PdpSimulatorException;
import org.onap.policy.models.sim.pdp.parameters.PdpSimulatorParameterGroup;
@@ -80,16 +80,7 @@ public class PdpSimulatorMain {
}
// Read the properties
- final Properties topicProperties = new Properties();
- try {
- final String propFile = arguments.getFullPropertyFilePath();
- try (FileInputStream stream = new FileInputStream(propFile)) {
- topicProperties.load(stream);
- }
- } catch (final Exception e) {
- LOGGER.error(PDP_SIMULATOR_FAIL_MSG, e);
- return;
- }
+ Properties topicProperties = ParameterUtils.getTopicProperties(parameterGroup.getTopicParameterGroup());
// create the activator
activator = new PdpSimulatorActivator(parameterGroup, topicProperties);
diff --git a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/parameters/PdpSimulatorParameterGroup.java b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/parameters/PdpSimulatorParameterGroup.java
index 58c583901..1b4df7bc6 100644
--- a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/parameters/PdpSimulatorParameterGroup.java
+++ b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/parameters/PdpSimulatorParameterGroup.java
@@ -21,7 +21,7 @@
package org.onap.policy.models.sim.pdp.parameters;
import lombok.Getter;
-
+import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
import org.onap.policy.common.parameters.ParameterGroupImpl;
import org.onap.policy.common.parameters.annotations.NotBlank;
import org.onap.policy.common.parameters.annotations.NotNull;
@@ -36,6 +36,7 @@ import org.onap.policy.common.parameters.annotations.NotNull;
@Getter
public class PdpSimulatorParameterGroup extends ParameterGroupImpl {
private PdpStatusParameters pdpStatusParameters;
+ private TopicParameterGroup topicParameterGroup;
/**
* Create the pdp simulator parameter group.