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 GetInput privileged;
51 private GetInput decompress;
54 private String scheme;
56 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){
57 TreeMap<String, LinkedHashMap<String, Object>> retInputs = inps;
58 LinkedHashMap<String, Object> stringType = new LinkedHashMap();
59 stringType.put("type", "string");
68 GetInput location = new GetInput();
69 location.setGet_input(key + "_" + name + "_location");
70 retInputs.put(key + "_" + name + "_location", stringType);
71 this.setLocation(location);
73 //if its data router we need to add some more
74 if(type.equals("data_router") || type.equals("data router")) {
77 GetInput username = new GetInput();
78 username.setGet_input(key + "_" + name + "_username");
79 this.setUsername(username);
80 retInputs.put(key + "_" + name + "_username", stringType);
83 GetInput password = new GetInput();
84 password.setGet_input(key + "_" + name + "_password");
85 this.setPassword(password);
86 retInputs.put(key + "_" + name + "_password", stringType);
89 GetInput priviliged = new GetInput();
90 priviliged.setGet_input(key + "_" + name + "_priviliged");
91 this.setPrivileged(priviliged);
92 retInputs.put(key + "_" + name + "_priviliged", stringType);
95 GetInput decompress = new GetInput();
96 decompress.setGet_input(key + "_" + name + "_decompress");
97 this.setDecompress(decompress);
98 retInputs.put(key + "_" + name + "_decompress", stringType);
100 this.setRoute(route);
101 this.setScheme("https");
104 // //set the delivery url
105 // GetInput delivery = new GetInput();
106 // delivery.setGet_input(name + "_delivery_url");
107 // this.setDelivery_url(delivery);
108 // retInputs.put(name + "delivery_url", stringType);
111 //set the client role
112 GetInput client = new GetInput();
113 client.setGet_input(key + "_" + name + "_client_role");
114 this.setClient_role(client);
115 retInputs.put(key + "_" + name + "_client_role", stringType);