From 72c2d38329865afa6692454b4fb90ab6f8a70638 Mon Sep 17 00:00:00 2001 From: Joanna Jeremicz Date: Thu, 25 Feb 2021 15:24:34 +0100 Subject: Fix sonar issues - Use Map instead of LinkedHashMap when possible - Rename some constants - Remove some commented lines - Add logger - Other minor improvements and refactor Issue-ID: DCAEGEN2-2636 Signed-off-by: Joanna Jeremicz Change-Id: I7a03cee453b3d254c4ff0fdf51c60a0ae4a61c42 --- .../service/common/StreamService.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StreamService.java') diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StreamService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StreamService.java index f27ea48..17699a8 100644 --- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StreamService.java +++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StreamService.java @@ -64,7 +64,7 @@ public class StreamService { OnapComponentSpec onapComponentSpec, BlueprintHelperService blueprintHelperService, DmaapService dmaapService, - Map> inputs, + Map> inputs, boolean isDmaap) { Map streamPublishes = new TreeMap<>(); @@ -75,23 +75,23 @@ public class StreamService { for (Publishes publishes : onapComponentSpec.getStreams().getPublishes()) { if (blueprintHelperService.isDataRouterType(publishes.getType())) { String config = publishes.getConfig_key(); - String name = config + Constants._FEED; + String name = config + Constants.A_FEED; Map dmaapDataRouterResponse = dmaapService.createDmaapDataRouter(inputs, config, name, isDmaap); inputs = - (Map>) dmaapDataRouterResponse + (Map>) dmaapDataRouterResponse .get("inputs"); Dmaap dmaap = (Dmaap) dmaapDataRouterResponse.get("dmaap"); dmaap.setType(publishes.getType()); streamPublishes.put(config, dmaap); } else if (blueprintHelperService.isMessageRouterType(publishes.getType())) { String config = publishes.getConfig_key(); - String name = config + Constants._TOPIC; + String name = config + Constants.A_TOPIC; Map dmaapDataRouterResponse = dmaapService .createDmaapMessageRouter(inputs, config, 'p', name, name, isDmaap); inputs = - (Map>) dmaapDataRouterResponse + (Map>) dmaapDataRouterResponse .get("inputs"); Dmaap dmaap = (Dmaap) dmaapDataRouterResponse.get("dmaap"); dmaap.setType(publishes.getType()); @@ -118,7 +118,7 @@ public class StreamService { OnapComponentSpec onapComponentSpec, BlueprintHelperService blueprintHelperService, DmaapService dmaapService, - Map> inputs, + Map> inputs, boolean isDmaap) { Map streamSubscribes = new TreeMap<>(); @@ -129,23 +129,23 @@ public class StreamService { for (Subscribes subscribes : onapComponentSpec.getStreams().getSubscribes()) { if (blueprintHelperService.isDataRouterType(subscribes.getType())) { String config = subscribes.getConfig_key(); - String name = config + Constants._FEED; + String name = config + Constants.A_FEED; Map dmaapDataRouterResponse = dmaapService.createDmaapDataRouter(inputs, config, name, isDmaap); inputs = - (Map>) dmaapDataRouterResponse + (Map>) dmaapDataRouterResponse .get("inputs"); Dmaap dmaap = (Dmaap) dmaapDataRouterResponse.get("dmaap"); dmaap.setType(subscribes.getType()); streamSubscribes.put(config, dmaap); } else if (blueprintHelperService.isMessageRouterType(subscribes.getType())) { String config = subscribes.getConfig_key(); - String name = config + Constants._TOPIC; + String name = config + Constants.A_TOPIC; Map dmaapDataRouterResponse = dmaapService .createDmaapMessageRouter(inputs, config, 's', name, name, isDmaap); inputs = - (Map>) dmaapDataRouterResponse + (Map>) dmaapDataRouterResponse .get("inputs"); Dmaap dmaap = (Dmaap) dmaapDataRouterResponse.get("dmaap"); dmaap.setType(subscribes.getType()); -- cgit 1.2.3-korg