bp-gen code clone from cli repo
[dcaegen2/platform.git] / mod / bpgenerator / src / main / java / org / onap / blueprintgenerator / models / blueprint / DmaapObj.java
1 /**============LICENSE_START======================================================= 
2  org.onap.dcae 
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 
9
10       http://www.apache.org/licenses/LICENSE-2.0 
11
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========================================================= 
18
19  */
20
21 package org.onap.blueprintgenerator.models.blueprint;
22
23 import java.util.LinkedHashMap;
24 import java.util.TreeMap;
25
26 import org.onap.blueprintgenerator.models.componentspec.ComponentSpec;
27
28 import com.fasterxml.jackson.annotation.JsonInclude;
29 import com.fasterxml.jackson.annotation.JsonInclude.Include;
30
31 import lombok.Getter; import lombok.Setter;
32 @JsonInclude(value=Include.NON_NULL)
33 @Getter @Setter
34 public class DmaapObj {
35         private String dmaap_info;
36         private String type;
37         private GetInput pass;
38         private GetInput user;
39
40         public TreeMap<String, LinkedHashMap<String, Object>> createOnapDmaapMRObj(TreeMap<String, LinkedHashMap<String, Object>> inps, String config, char type, String n, String num) {
41                 TreeMap<String, LinkedHashMap<String, Object>> retInputs = new TreeMap<String, LinkedHashMap<String, Object>>();
42                 LinkedHashMap<String, Object> stringType = new LinkedHashMap();
43                 stringType.put("type", "string");
44                 retInputs = inps;
45
46                 //set the dmaapinfo
47                 DmaapInfo info = new DmaapInfo();
48                 String infoType = "<<" + n + ">>";
49                 this.setDmaap_info(infoType);
50
51                 //set username
52                 GetInput u = new GetInput();
53                 u.setGet_input(config + "_" + num +"_aaf_username");
54                 this.setUser(u);
55                 retInputs.put(config + "_" + num +"_aaf_username", stringType);
56
57                 //set password
58                 GetInput p = new GetInput();
59                 p.setGet_input(config + "_" + num +"_aaf_password");
60                 this.setPass(p);
61                 retInputs.put(config + "_" + num +"_aaf_password", stringType);
62
63                 return retInputs;
64         }
65         public TreeMap<String, LinkedHashMap<String, Object>> createOnapDmaapDRObj(TreeMap<String, LinkedHashMap<String, Object>> inps, String config, char type, String n, String num) {
66                 TreeMap<String, LinkedHashMap<String, Object>> retInputs = new TreeMap<String, LinkedHashMap<String, Object>>();
67                 retInputs = inps;
68                 
69                 //set the dmaapinfo
70                 DmaapInfo info = new DmaapInfo();
71                 String infoType = "<<" + n + ">>";
72                 this.setDmaap_info(infoType);
73                 return retInputs;
74         }
75 }