aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/dcae/common/publishing/DMaaPConfigurationParser.java
diff options
context:
space:
mode:
authorMaciej Malewski <maciej.malewski@nokia.com>2021-06-08 09:04:48 +0200
committerMaciej Malewski <maciej.malewski@nokia.com>2021-06-17 10:03:49 +0200
commit74b598291ed2461e0e482f556baf2943a97a54f2 (patch)
tree22e1140bc0f27680be4d47d40b0c94f7205b45b3 /src/main/java/org/onap/dcae/common/publishing/DMaaPConfigurationParser.java
parent26be283f4a7044aea4ee0ca480fde20eb5233ee2 (diff)
Replace cambria with DmaaP client
- remove cambria, add DmaaP client - sending event for many topics at once is no longer supported - add backward compatibility status codes - add additional validation for batchEvent Issue-ID: DCAEGEN2-1483 Signed-off-by: Maciej Malewski <maciej.malewski@nokia.com> Change-Id: I945c38b4ab04b697ecfabd5ce38502f83fa70d1a
Diffstat (limited to 'src/main/java/org/onap/dcae/common/publishing/DMaaPConfigurationParser.java')
-rw-r--r--src/main/java/org/onap/dcae/common/publishing/DMaaPConfigurationParser.java20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/main/java/org/onap/dcae/common/publishing/DMaaPConfigurationParser.java b/src/main/java/org/onap/dcae/common/publishing/DMaaPConfigurationParser.java
index 274e4490..9f8ffcc6 100644
--- a/src/main/java/org/onap/dcae/common/publishing/DMaaPConfigurationParser.java
+++ b/src/main/java/org/onap/dcae/common/publishing/DMaaPConfigurationParser.java
@@ -63,28 +63,10 @@ public final class DMaaPConfigurationParser {
}
private static Try<Map<String, PublisherConfig>> toConfigMap(AnyNode config) {
- return Try(() -> usesLegacyFormat(config) ? parseLegacyFormat(config) : parseNewFormat(config))
+ return Try(() -> parseNewFormat(config))
.mapFailure(enhanceError(f("Parsing DMaaP configuration: '%s' failed, probably it is in unexpected format", config)));
}
- private static boolean usesLegacyFormat(AnyNode dMaaPConfig) {
- return dMaaPConfig.has("channels");
- }
-
- private static Map<String, PublisherConfig> parseLegacyFormat(AnyNode root) {
- return root.get("channels").toList().toMap(
- channel -> channel.get("name").toString(),
- channel -> {
- String destinationsStr = channel.getAsOption("cambria.url")
- .getOrElse(channel.getAsOption("cambria.hosts").get())
- .toString();
- String topic = channel.get("cambria.topic").toString();
- Option<String> maybeUser = channel.getAsOption("basicAuthUsername").map(AnyNode::toString);
- Option<String> maybePassword = channel.getAsOption("basicAuthPassword").map(AnyNode::toString);
- List<String> destinations = List(destinationsStr.split(","));
- return buildBasedOnAuth(maybeUser, maybePassword, topic, destinations);
- });
- }
private static Map<String, PublisherConfig> parseNewFormat(AnyNode root) {
return root.keys().toMap(