X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=mod%2Fbpgenerator%2Fonap%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fblueprintgenerator%2Fservice%2Fdmaap%2FStreamsService.java;h=8437304ae7a85188dd06a605e09850359e4ee254;hb=72c2d38329865afa6692454b4fb90ab6f8a70638;hp=16687fc384ad205387210c336c00520d2a65b004;hpb=3f0bbed7e1b96d1982d55e26c27169885aa3067c;p=dcaegen2%2Fplatform.git diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/dmaap/StreamsService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/dmaap/StreamsService.java index 16687fc..8437304 100644 --- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/dmaap/StreamsService.java +++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/dmaap/StreamsService.java @@ -4,6 +4,7 @@ * * org.onap.dcae * * ================================================================================ * * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved. + * * Copyright (c) 2021 Nokia. 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. @@ -35,24 +36,36 @@ import java.util.Map; /** * @author : Ravi Mantena - * @date 10/16/2020 - * Application: ONAP - Blueprint Generator - * Service to create Streams + * @date 10/16/2020 Application: ONAP - Blueprint Generator Service to create Streams */ - - @Service public class StreamsService { @Autowired private BlueprintHelperService blueprintHelperService; - //Methos to create streams for Dmaap Blueprint - public Map createStreams(Map> inputs, String name, String type, String key, String route, char o){ - Map response = new HashMap<>(); + /** + * Creates streams for Dmaap Blueprint + * + * @param inputs Inputs + * @param name Name + * @param type Type + * @param key Key + * @param route Route + * @param o For Data Router Type s + * @return + */ + public Map createStreams( + Map> inputs, + String name, + String type, + String key, + String route, + char o) { + Map response = new HashMap<>(); Streams streams = new Streams(); - LinkedHashMap stringType = new LinkedHashMap(); + Map stringType = new LinkedHashMap(); stringType.put("type", "string"); streams.setName(name); @@ -63,8 +76,8 @@ public class StreamsService { inputs.put(key + "_" + name + "_location", stringType); streams.setLocation(location); - if(blueprintHelperService.isDataRouterType(type)) { - if('s' == o) { + if (blueprintHelperService.isDataRouterType(type)) { + if ('s' == o) { GetInput username = new GetInput(); username.setBpInputName(key + "_" + name + "_username"); streams.setUsername(username); @@ -89,7 +102,6 @@ public class StreamsService { streams.setScheme("https"); } - } else { GetInput client = new GetInput(); client.setBpInputName(key + "_" + name + "_client_role"); @@ -100,5 +112,4 @@ public class StreamsService { response.put("inputs", inputs); return response; } - }