aboutsummaryrefslogtreecommitdiffstats
path: root/models-sim
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-07-08 09:53:26 -0400
committerJim Hahn <jrh3@att.com>2019-07-08 09:53:26 -0400
commit9d4d28c05d214e906731f4bf536e1428df6925b6 (patch)
treef8275d69ba67b49cfe03094fea24d88840cf4507 /models-sim
parentc5231f939d724dd59cb385d8521924a1bff19cee (diff)
Fix models due to sonar changes in common
Fixed breakages due to changes made in policy/common to satisfy sonar. Change-Id: I7de701e743664afb5963a454c59478d1a1c83e87 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-sim')
-rw-r--r--models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/rest/DmaapSimRestServer.java4
-rw-r--r--models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorActivator.java10
-rw-r--r--models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/TestPdpSimulatorActivator.java3
3 files changed, 9 insertions, 8 deletions
diff --git a/models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/rest/DmaapSimRestServer.java b/models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/rest/DmaapSimRestServer.java
index 6853cc9dc..28de42c21 100644
--- a/models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/rest/DmaapSimRestServer.java
+++ b/models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/rest/DmaapSimRestServer.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019 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.
@@ -26,6 +27,7 @@ import java.util.Properties;
import org.onap.policy.common.capabilities.Startable;
import org.onap.policy.common.endpoints.http.server.HttpServletServer;
+import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
import org.onap.policy.models.sim.dmaap.parameters.RestServerParameters;
import org.slf4j.Logger;
@@ -57,7 +59,7 @@ public class DmaapSimRestServer implements Startable {
@Override
public boolean start() {
try {
- servers = HttpServletServer.factory.build(getServerProperties());
+ servers = HttpServletServerFactoryInstance.getServerFactory().build(getServerProperties());
for (final HttpServletServer server : servers) {
server.start();
}
diff --git a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorActivator.java b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorActivator.java
index 502dec7b3..735784ee6 100644
--- a/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorActivator.java
+++ b/models-sim/policy-models-sim-pdp/src/main/java/org/onap/policy/models/sim/pdp/PdpSimulatorActivator.java
@@ -26,7 +26,7 @@ import java.util.Properties;
import java.util.Random;
import lombok.Getter;
import lombok.Setter;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpoint;
+import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
import org.onap.policy.common.endpoints.event.comm.TopicSink;
import org.onap.policy.common.endpoints.event.comm.TopicSource;
import org.onap.policy.common.endpoints.listeners.MessageTypeDispatcher;
@@ -82,8 +82,8 @@ public class PdpSimulatorActivator {
public PdpSimulatorActivator(final PdpSimulatorParameterGroup pdpSimulatorParameterGroup,
final Properties topicProperties) {
- topicSinks = TopicEndpoint.manager.addTopicSinks(topicProperties);
- topicSources = TopicEndpoint.manager.addTopicSources(topicProperties);
+ topicSinks = TopicEndpointManager.getManager().addTopicSinks(topicProperties);
+ topicSources = TopicEndpointManager.getManager().addTopicSources(topicProperties);
final int random = RANDOM.nextInt();
final String instanceId = "pdp_" + random;
@@ -100,8 +100,8 @@ public class PdpSimulatorActivator {
// @formatter:off
this.manager = new ServiceManager()
.addAction("topics",
- TopicEndpoint.manager::start,
- TopicEndpoint.manager::shutdown)
+ TopicEndpointManager.getManager()::start,
+ TopicEndpointManager.getManager()::shutdown)
.addAction("set alive",
() -> setAlive(true),
() -> setAlive(false))
diff --git a/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/TestPdpSimulatorActivator.java b/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/TestPdpSimulatorActivator.java
index dbf7bbcea..b2ab08760 100644
--- a/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/TestPdpSimulatorActivator.java
+++ b/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/TestPdpSimulatorActivator.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019 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.
@@ -27,9 +28,7 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import java.io.FileInputStream;
import java.util.Properties;
-
import org.junit.After;
import org.junit.Before;
import org.junit.Test;