1 /**============LICENSE_START=======================================================
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
12 http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
22 package org.onap.blueprintgenerator.models.componentspec;
25 import java.util.ArrayList;
26 import java.util.LinkedHashMap;
27 import java.util.TreeMap;
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;
34 import lombok.AllArgsConstructor;
35 import lombok.Builder;
36 import lombok.Getter; import lombok.Setter;
37 import lombok.NoArgsConstructor;
39 // TODO: Auto-generated Javadoc
41 * @see java.lang.Object#toString()
46 * @see java.lang.Object#toString()
51 * Instantiates a new auxilary.
56 * Instantiates a new auxilary.
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
66 @JsonInclude(value=Include.NON_NULL)
67 //Called in component Spec Object
68 public class Auxilary {
70 /** The healthcheck. */
71 private HealthCheck healthcheck;
74 @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
75 private TreeMap<String, Object> log_info;
78 @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
79 private TreeMap<String, Object> tls_info;
82 private Volumes[] volumes;
85 private Policy policy;
88 @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
89 private ArrayList<Object> ports;
92 private ReconfigsObj reconfigs;
95 @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
96 private TreeMap<String, String> databases;
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");
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);
116 // if(p.charAt(i) == ':' && !foundPort) {
117 // external = p.substring(i);
118 // portType.put("default", external);
119 // retInputs.put("external_port", portType);
122 // internal = internal + p.charAt(i);
127 // this.setPorts(ports);