aboutsummaryrefslogtreecommitdiffstats
path: root/policy-endpoints/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'policy-endpoints/src/main')
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxy.java12
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicSourceFactory.java9
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/common/endpoints/parameters/TopicParameterGroup.java5
3 files changed, 11 insertions, 15 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxy.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxy.java
index c9e73152..9aabad52 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxy.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxy.java
@@ -22,6 +22,7 @@ package org.onap.policy.common.endpoints.event.comm;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Properties;
import org.onap.policy.common.capabilities.Startable;
@@ -69,9 +70,14 @@ class TopicEndpointProxy implements TopicEndpoint {
@Override
public List<Topic> addTopics(TopicParameterGroup params) {
- List<Topic> topics = new ArrayList<>(params.getTopicSinks().size() + params.getTopicSources().size());
- topics.addAll(addTopicSources(params.getTopicSources()));
- topics.addAll(addTopicSinks(params.getTopicSinks()));
+ List<TopicParameters> sinks =
+ (params.getTopicSinks() != null ? params.getTopicSinks() : Collections.emptyList());
+ List<TopicParameters> sources =
+ (params.getTopicSources() != null ? params.getTopicSources() : Collections.emptyList());
+
+ List<Topic> topics = new ArrayList<>(sinks.size() + sources.size());
+ topics.addAll(addTopicSources(sources));
+ topics.addAll(addTopicSinks(sinks));
return topics;
}
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicSourceFactory.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicSourceFactory.java
index 7164f919..ca5e41d3 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicSourceFactory.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicSourceFactory.java
@@ -21,7 +21,6 @@
package org.onap.policy.common.endpoints.event.comm.bus;
import java.util.List;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
/**
@@ -41,14 +40,6 @@ public class NoopTopicSourceFactory extends NoopTopicFactory<NoopTopicSource> {
* {@inheritDoc}.
*/
@Override
- public NoopTopicSource build(BusTopicParams param) {
- return build(param.getServers(), param.getTopic());
- }
-
- /**
- * {@inheritDoc}.
- */
- @Override
protected NoopTopicSource build(List<String> servers, String topic) {
return new NoopTopicSource(servers, topic);
}
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/parameters/TopicParameterGroup.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/parameters/TopicParameterGroup.java
index eab9c12f..4cd3893d 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/parameters/TopicParameterGroup.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/parameters/TopicParameterGroup.java
@@ -21,7 +21,6 @@
package org.onap.policy.common.endpoints.parameters;
-import java.util.LinkedList;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
@@ -43,8 +42,8 @@ import org.onap.policy.common.parameters.annotations.NotNull;
@Setter
public class TopicParameterGroup extends ParameterGroupImpl {
- private final List<TopicParameters> topicSources = new LinkedList<>();
- private final List<TopicParameters> topicSinks = new LinkedList<>();
+ private List<TopicParameters> topicSources;
+ private List<TopicParameters> topicSinks;
public TopicParameterGroup() {
super(TopicParameterGroup.class.getSimpleName());