1 /*============LICENSE_START=======================================================
3 ================================================================================
4 Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
5 Copyright (c) 2020 Nokia. All rights reserved.
6 ================================================================================
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18 ============LICENSE_END=========================================================
22 package org.onap.blueprintgenerator.models.dmaapbp;
24 import java.util.LinkedHashMap;
25 import java.util.TreeMap;
27 import org.onap.blueprintgenerator.models.blueprint.GetInput;
28 import org.onap.blueprintgenerator.models.componentspec.ComponentSpec;
30 import com.fasterxml.jackson.annotation.JsonInclude;
31 import com.fasterxml.jackson.annotation.JsonInclude.Include;
37 @JsonInclude(value=Include.NON_NULL)
38 public class DmaapStreams {
41 private GetInput location;
42 private GetInput client_role;
45 private GetInput username;
46 private GetInput password;
47 //private GetInput delivery_url;
49 private GetInput privileged;
50 private GetInput decompress;
53 private String scheme;
55 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){
56 TreeMap<String, LinkedHashMap<String, Object>> retInputs = inps;
57 LinkedHashMap<String, Object> stringType = new LinkedHashMap();
58 stringType.put("type", "string");
67 GetInput location = new GetInput();
68 location.setBpInputName(key + "_" + name + "_location");
69 retInputs.put(key + "_" + name + "_location", stringType);
70 this.setLocation(location);
72 //if its data router we need to add some more
73 if(type.equals("data_router") || type.equals("data router")) {
76 GetInput username = new GetInput();
77 username.setBpInputName(key + "_" + name + "_username");
78 this.setUsername(username);
79 retInputs.put(key + "_" + name + "_username", stringType);
82 GetInput password = new GetInput();
83 password.setBpInputName(key + "_" + name + "_password");
84 this.setPassword(password);
85 retInputs.put(key + "_" + name + "_password", stringType);
88 GetInput priviliged = new GetInput();
89 priviliged.setBpInputName(key + "_" + name + "_priviliged");
90 this.setPrivileged(priviliged);
91 retInputs.put(key + "_" + name + "_priviliged", stringType);
94 GetInput decompress = new GetInput();
95 decompress.setBpInputName(key + "_" + name + "_decompress");
96 this.setDecompress(decompress);
97 retInputs.put(key + "_" + name + "_decompress", stringType);
100 this.setScheme("https");
103 // //set the delivery url
104 // GetInput delivery = new GetInput();
105 // delivery.setGet_input(name + "_delivery_url");
106 // this.setDelivery_url(delivery);
107 // retInputs.put(name + "delivery_url", stringType);
110 //set the client role
111 GetInput client = new GetInput();
112 client.setBpInputName(key + "_" + name + "_client_role");
113 this.setClient_role(client);
114 retInputs.put(key + "_" + name + "_client_role", stringType);