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=========================================================
20 package org.onap.blueprintgenerator.models.componentspec;
23 import java.util.ArrayList;
24 import java.util.LinkedHashMap;
25 import java.util.TreeMap;
27 import com.fasterxml.jackson.annotation.JsonIgnore;
28 import com.fasterxml.jackson.annotation.JsonInclude;
29 import com.fasterxml.jackson.annotation.JsonInclude.Include;
30 import com.fasterxml.jackson.annotation.JsonProperty;
32 import lombok.AllArgsConstructor;
33 import lombok.Builder;
34 import lombok.Getter; import lombok.Setter;
35 import lombok.NoArgsConstructor;
37 // TODO: Auto-generated Javadoc
39 * @see java.lang.Object#toString()
44 * @see java.lang.Object#toString()
49 * Instantiates a new auxilary.
54 * Instantiates a new auxilary.
56 * @param healthcheck the healthcheck
57 * @param volumes the volumes
58 * @param policy the policy
59 * @param ports the ports
60 * @param reconfigs the reconfigs
61 * @param databases the databases
64 @JsonInclude(value=Include.NON_NULL)
65 //Called in component Spec Object
66 public class Auxilary {
68 /** The healthcheck. */
69 private HealthCheck healthcheck;
72 @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
73 private TreeMap<String, Object> log_info;
76 @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
77 private TreeMap<String, Object> tls_info;
80 private Volumes[] volumes;
83 private Policy policy;
86 @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
87 private ArrayList<Object> ports;
90 private ReconfigsObj reconfigs;
93 @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
94 private TreeMap<String, String> databases;
97 // public TreeMap<String, LinkedHashMap<String, Object>> createPorts(TreeMap<String, LinkedHashMap<String, Object>> inps) {
98 // TreeMap<String, LinkedHashMap<String, Object>> retInputs = inps;
99 // LinkedHashMap<String, Object> portType = new LinkedHashMap();
100 // portType.put("type", "string");
102 // ArrayList<Object> ports = new ArrayList();
103 // String external = "";
104 // boolean foundPort = false;
105 // for(Object o: this.getPorts()) {
106 // String internal = "";
107 // String p = o.toString();
108 // for(int i = 0; i < p.length(); i++) {
109 // if(p.charAt(i) == ':') {
110 // internal = '"' + internal + '"';
111 // internal = "concat: ['" + internal + "', {get_input: external_port}]";
112 // ports.add(internal);
114 // if(p.charAt(i) == ':' && !foundPort) {
115 // external = p.substring(i);
116 // portType.put("default", external);
117 // retInputs.put("external_port", portType);
120 // internal = internal + p.charAt(i);
125 // this.setPorts(ports);