1 /**============LICENSE_START=======================================================
3 ================================================================================
4 Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
5 ================================================================================
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17 ============LICENSE_END=========================================================
21 package org.onap.blueprintgenerator.models.dmaapbp;
23 import java.util.LinkedHashMap;
24 import java.util.TreeMap;
26 import org.onap.blueprintgenerator.models.blueprint.Appconfig;
27 import org.onap.blueprintgenerator.models.blueprint.GetInput;
28 import org.onap.blueprintgenerator.models.componentspec.ComponentSpec;
29 import org.onap.blueprintgenerator.models.componentspec.HealthCheck;
31 import com.fasterxml.jackson.annotation.JsonInclude;
32 import com.fasterxml.jackson.annotation.JsonInclude.Include;
38 @JsonInclude(value=Include.NON_NULL)
39 public class DmaapStreams {
42 private GetInput location;
43 private GetInput client_role;
46 private GetInput username;
47 private GetInput password;
48 //private GetInput delivery_url;
50 private String scheme;
52 public TreeMap<String, LinkedHashMap<String, Object>> createStreams(TreeMap<String, LinkedHashMap<String, Object>> inps, ComponentSpec cs, String name, String type, String key, String route, char o){
53 TreeMap<String, LinkedHashMap<String, Object>> retInputs = inps;
54 LinkedHashMap<String, Object> stringType = new LinkedHashMap();
55 stringType.put("type", "string");
64 GetInput location = new GetInput();
65 location.setGet_input(key + "_" + name + "_location");
66 retInputs.put(key + "_" + name + "_location", stringType);
67 this.setLocation(location);
69 //if its data router we need to add some more
70 if(type.equals("data_router") || type.equals("data router")) {
73 GetInput username = new GetInput();
74 username.setGet_input(key + "_" + name + "_username");
75 this.setUsername(username);
76 retInputs.put(key + "_" + name + "_username", stringType);
79 GetInput password = new GetInput();
80 password.setGet_input(key + "_" + name + "_password");
81 this.setPassword(password);
82 retInputs.put(key + "_" + name + "_password", stringType);
85 this.setScheme("https");
88 // //set the delivery url
89 // GetInput delivery = new GetInput();
90 // delivery.setGet_input(name + "_delivery_url");
91 // this.setDelivery_url(delivery);
92 // retInputs.put(name + "delivery_url", stringType);
96 GetInput client = new GetInput();
97 client.setGet_input(key + "_" + name + "_client_role");
98 this.setClient_role(client);
99 retInputs.put(key + "_" + name + "_client_role", stringType);