summaryrefslogtreecommitdiffstats
path: root/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/UebTopicSinkFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/UebTopicSinkFactory.java')
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/UebTopicSinkFactory.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/UebTopicSinkFactory.java b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/UebTopicSinkFactory.java
index fc4229c3..10468bef 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/UebTopicSinkFactory.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/UebTopicSinkFactory.java
@@ -1,8 +1,8 @@
-/*-
+/*
* ============LICENSE_START=======================================================
* policy-endpoints
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 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.
@@ -116,6 +116,8 @@ public interface UebTopicSinkFactory {
* Factory of UEB Reader Topics indexed by topic name
*/
class IndexedUebTopicSinkFactory implements UebTopicSinkFactory {
+ private static final String MISSING_TOPIC = "A topic must be provided";
+
/**
* Logger
*/
@@ -142,7 +144,7 @@ class IndexedUebTopicSinkFactory implements UebTopicSinkFactory {
}
if (topic == null || topic.isEmpty()) {
- throw new IllegalArgumentException("A topic must be provided");
+ throw new IllegalArgumentException(MISSING_TOPIC);
}
synchronized (this) {
@@ -245,7 +247,7 @@ class IndexedUebTopicSinkFactory implements UebTopicSinkFactory {
public void destroy(String topic) {
if (topic == null || topic.isEmpty()) {
- throw new IllegalArgumentException("A topic must be provided");
+ throw new IllegalArgumentException(MISSING_TOPIC);
}
UebTopicSink uebTopicWriter;
@@ -276,7 +278,7 @@ class IndexedUebTopicSinkFactory implements UebTopicSinkFactory {
public UebTopicSink get(String topic) {
if (topic == null || topic.isEmpty()) {
- throw new IllegalArgumentException("A topic must be provided");
+ throw new IllegalArgumentException(MISSING_TOPIC);
}
synchronized(this) {
@@ -290,9 +292,7 @@ class IndexedUebTopicSinkFactory implements UebTopicSinkFactory {
@Override
public synchronized List<UebTopicSink> inventory() {
- List<UebTopicSink> writers =
- new ArrayList<>(this.uebTopicSinks.values());
- return writers;
+ return new ArrayList<>(this.uebTopicSinks.values());
}