Add external tls info to bpgenerator and component spec schema
[dcaegen2/platform.git] / mod / bpgenerator / src / main / java / org / onap / blueprintgenerator / models / componentspec / Auxilary.java
1 /**============LICENSE_START=======================================================
2  org.onap.dcae
3  ================================================================================
4  Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
5  ================================================================================
6  Modifications Copyright (c) 2020 Nokia. All rights reserved.
7  ================================================================================
8  Licensed under the Apache License, Version 2.0 (the "License");
9  you may not use this file except in compliance with the License.
10  You may obtain a copy of the License at
11  
12       http://www.apache.org/licenses/LICENSE-2.0
13  
14  Unless required by applicable law or agreed to in writing, software
15  distributed under the License is distributed on an "AS IS" BASIS,
16  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  See the License for the specific language governing permissions and
18  limitations under the License.
19  ============LICENSE_END=========================================================
20  
21  */
22 package org.onap.blueprintgenerator.models.componentspec;
23
24
25 import java.util.ArrayList;
26 import java.util.LinkedHashMap;
27 import java.util.TreeMap;
28
29 import com.fasterxml.jackson.annotation.JsonIgnore;
30 import com.fasterxml.jackson.annotation.JsonInclude;
31 import com.fasterxml.jackson.annotation.JsonInclude.Include;
32 import com.fasterxml.jackson.annotation.JsonProperty;
33
34 import lombok.AllArgsConstructor;
35 import lombok.Builder;
36 import lombok.Getter; import lombok.Setter;
37 import lombok.NoArgsConstructor;
38
39 // TODO: Auto-generated Javadoc
40 /* (non-Javadoc)
41  * @see java.lang.Object#toString()
42  */
43 @Getter @Setter
44
45 /* (non-Javadoc)
46  * @see java.lang.Object#toString()
47  */
48
49
50 /**
51  * Instantiates a new auxilary.
52  */
53 @NoArgsConstructor
54
55 /**
56  * Instantiates a new auxilary.
57  *
58  * @param healthcheck the healthcheck
59  * @param volumes the volumes
60  * @param policy the policy
61  * @param ports the ports
62  * @param reconfigs the reconfigs
63  * @param databases the databases
64  */
65
66 @JsonInclude(value=Include.NON_NULL)
67 //Called in component Spec Object
68 public class Auxilary {
69         
70         /** The healthcheck. */
71         private HealthCheck healthcheck;
72
73         /**log-directory**/
74         @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
75         private TreeMap<String, Object> log_info;
76
77         /**tls-info**/
78         @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
79         private TreeMap<String, Object> tls_info;
80
81         /** The volumes. */
82         private Volumes[] volumes;
83
84         /** The policy. */
85         private Policy policy;
86
87         /** The ports. */
88         @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
89         private ArrayList<Object> ports;
90
91         /** The reconfigs. */
92         private ReconfigsObj reconfigs;
93
94         /** The databases. */
95         @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
96         private TreeMap<String, String> databases;
97
98
99 //      public TreeMap<String, LinkedHashMap<String, Object>> createPorts(TreeMap<String, LinkedHashMap<String, Object>> inps) {
100 //              TreeMap<String, LinkedHashMap<String, Object>> retInputs = inps;
101 //              LinkedHashMap<String, Object> portType = new LinkedHashMap();
102 //              portType.put("type", "string");
103 //
104 //              ArrayList<Object> ports = new ArrayList();
105 //              String external = "";
106 //              boolean foundPort = false;
107 //              for(Object o: this.getPorts()) {
108 //                      String internal = "";
109 //                      String p = o.toString();
110 //                      for(int i = 0; i < p.length(); i++) {
111 //                              if(p.charAt(i) == ':') {
112 //                                      internal = '"' + internal + '"';
113 //                                      internal = "concat: ['" + internal + "', {get_input: external_port}]";
114 //                                      ports.add(internal);
115 //                              }
116 //                              if(p.charAt(i) == ':' && !foundPort) {
117 //                                      external = p.substring(i);
118 //                                      portType.put("default", external);
119 //                                      retInputs.put("external_port", portType);
120 //
121 //                              }
122 //                              internal = internal + p.charAt(i);
123 //
124 //                      }
125 //              }
126 //
127 //              this.setPorts(ports);
128 //              return retInputs;
129 //      }
130 }