- Map<String, Dmaap> streamPublishes = new TreeMap<>();
- if (onapComponentSpec.getStreams() != null) {
- if (onapComponentSpec.getStreams().getPublishes() != null) {
- for (Publishes publishes : onapComponentSpec.getStreams().getPublishes()) {
- if (blueprintHelperService.isDataRouterType(publishes.getType())) {
- String config = publishes.getConfig_key();
- String name = config + Constants._FEED;
- Map<String, Object> dmaapDataRouterResponse =
- dmaapService.createDmaapDataRouter(inputs, config, name, isDmaap);
- inputs =
- (Map<String, LinkedHashMap<String, Object>>) 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;
- Map<String, Object> dmaapDataRouterResponse =
- dmaapService
- .createDmaapMessageRouter(inputs, config, 'p', name, name, isDmaap);
- inputs =
- (Map<String, LinkedHashMap<String, Object>>) dmaapDataRouterResponse
- .get("inputs");
- Dmaap dmaap = (Dmaap) dmaapDataRouterResponse.get("dmaap");
- dmaap.setType(publishes.getType());
- streamPublishes.put(config, dmaap);
- }
- }
- }
- }
-
- Map<String, Dmaap> streamSubscribes = new TreeMap<>();
-
- if (onapComponentSpec.getStreams() != null) {
- if (onapComponentSpec.getStreams().getSubscribes() != null) {
- for (Subscribes subscribes : onapComponentSpec.getStreams().getSubscribes()) {
- if (blueprintHelperService.isDataRouterType(subscribes.getType())) {
- String config = subscribes.getConfig_key();
- String name = config + Constants._FEED;
- Map<String, Object> dmaapDataRouterResponse =
- dmaapService.createDmaapDataRouter(inputs, config, name, isDmaap);
- inputs =
- (Map<String, LinkedHashMap<String, Object>>) 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;
- Map<String, Object> dmaapDataRouterResponse =
- dmaapService
- .createDmaapMessageRouter(inputs, config, 's', name, name, isDmaap);
- inputs =
- (Map<String, LinkedHashMap<String, Object>>) dmaapDataRouterResponse
- .get("inputs");
- Dmaap dmaap = (Dmaap) dmaapDataRouterResponse.get("dmaap");
- dmaap.setType(subscribes.getType());
- streamSubscribes.put(config, dmaap);
- }
- }
- }
- }