2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.mso.db.catalog.beans;
24 import java.io.Serializable;
25 import java.sql.Timestamp;
26 import java.text.DateFormat;
27 import java.util.HashSet;
29 import java.util.List;
30 import java.util.ArrayList;
32 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
34 public class VnfResource extends MavenLikeVersioning implements Serializable {
36 private static final long serialVersionUID = 768026109321305392L;
38 private String modelUuid = null;
39 private String modelInvariantUuid = null;
40 private String modelName = null;
41 private String toscaNodeType = null;
42 private String description = null;
43 private String orchestrationMode = null;
44 private String aicVersionMin = null;
45 private String aicVersionMax = null;
46 private String category = null;
47 private String subCategory = null;
48 private String heatTemplateArtifactUUId = null;
49 private Timestamp created = null;
50 private String modelVersion = null;
51 private Set<VnfResourceCustomization> vnfResourceCustomizations = new HashSet<>();
52 private Set<VfModule> vfModules = new HashSet<>();
53 private List<VfModuleCustomization> vfModuleCustomizations = new ArrayList<>();
55 public VnfResource () { }
57 public String getOrchestrationMode () {
58 return orchestrationMode;
61 public void setOrchestrationMode (String orchestrationMode) {
62 this.orchestrationMode = orchestrationMode;
65 public String getDescription () {
69 public void setDescription (String description) {
70 this.description = description;
73 public String getTemplateId () {
74 return heatTemplateArtifactUUId;
77 public void setTemplateId (String heatTemplateArtifactUUId) {
78 this.heatTemplateArtifactUUId = heatTemplateArtifactUUId;
80 public String getHeatTemplateArtifactUUId () {
81 return heatTemplateArtifactUUId;
84 public void setHeatTemplateArtifactUUId (String heatTemplateArtifactUUId) {
85 this.heatTemplateArtifactUUId = heatTemplateArtifactUUId;
88 public Timestamp getCreated() {
92 public void setCreated(Timestamp created) {
93 this.created = created;
96 public String getAicVersionMin() {
97 return this.aicVersionMin;
100 public void setAicVersionMin(String aicVersionMin) {
101 this.aicVersionMin = aicVersionMin;
104 public String getAicVersionMax() {
105 return this.aicVersionMax;
108 public void setAicVersionMax(String aicVersionMax) {
109 this.aicVersionMax = aicVersionMax;
114 * @return Returns the category.
116 public String getCategory() {
122 * @param category The category to set.
124 public void setCategory(String category) {
125 this.category = category;
130 * @return Returns the subCategory.
132 public String getSubCategory() {
138 * @param subCategory The subCategory to set.
140 public void setSubCategory(String subCategory) {
141 this.subCategory = subCategory;
144 public String getModelInvariantUuid() {
145 return this.modelInvariantUuid;
148 public void setModelInvariantUuid(String modelInvariantUuid) {
149 this.modelInvariantUuid = modelInvariantUuid;
152 public String getModelName() {
156 public void setModelName(String modelName) {
157 this.modelName = modelName;
160 public String getModelUuid() {
164 public void setModelUuid(String modelUuid) {
165 this.modelUuid = modelUuid;
168 public String getModelInvariantId() {
169 return this.modelInvariantUuid;
172 public String getToscaNodeType() {
173 return toscaNodeType;
176 public void setToscaNodeType(String toscaNodeType) {
177 this.toscaNodeType = toscaNodeType;
180 public Set<VnfResourceCustomization> getVnfResourceCustomizations() {
181 return vnfResourceCustomizations;
184 public void setVnfResourceCustomizations(Set<VnfResourceCustomization> vnfResourceCustomizations) {
185 this.vnfResourceCustomizations = vnfResourceCustomizations;
188 public Set<VfModule> getVfModules() {
192 public void setVfModules(Set<VfModule> vfModules) {
193 this.vfModules = vfModules;
196 public List<VfModuleCustomization> getVfModuleCustomizations() {
197 return this.vfModuleCustomizations == null ? new ArrayList<>() : this.vfModuleCustomizations;
199 public void setVfModuleCustomizations(List<VfModuleCustomization> vfModuleCustomizations) {
200 this.vfModuleCustomizations = vfModuleCustomizations;
202 public void addVfModuleCustomization(VfModuleCustomization vfmc) {
204 if (this.vfModuleCustomizations != null) {
205 this.vfModuleCustomizations.add(vfmc);
207 this.vfModuleCustomizations = new ArrayList<>();
208 this.vfModuleCustomizations.add(vfmc);
213 public void addVfModule(VfModule vfm) {
215 if (this.vfModules != null) {
216 this.vfModules.add(vfm);
218 this.vfModules = new HashSet<>();
219 this.vfModules.add(vfm);
223 public ArrayList<VfModule> getVfModuleList() {
224 if (this.vfModules == null || this.vfModules.size() < 1) {
227 ArrayList<VfModule> list = new ArrayList<>();
228 list.addAll(this.vfModules);
232 public String getModelVersion() {
236 public void setModelVersion(String modelVersion) {
237 this.modelVersion = modelVersion;
241 public String toString () {
242 StringBuilder sb = new StringBuilder();
245 sb.append(",modelVersion=");
246 sb.append(modelVersion);
248 sb.append(orchestrationMode);
249 sb.append(",heatTemplateArtifactUUId=");
250 sb.append(heatTemplateArtifactUUId);
251 sb.append(",envtId=");
252 sb.append(",asdcUuid=");
253 sb.append(",aicVersionMin=");
254 sb.append(this.aicVersionMin);
255 sb.append(",aicVersionMax=");
256 sb.append(this.aicVersionMax);
257 sb.append(",modelInvariantUuid=");
258 sb.append(this.modelInvariantUuid);
259 sb.append(",modelVersion=");
260 sb.append(",modelCustomizationName=");
261 sb.append(",modelName=");
262 sb.append(this.modelName);
263 sb.append(",serviceModelInvariantUUID=");
264 sb.append(",modelCustomizationUuid=");
265 sb.append(",toscaNodeType=");
266 sb.append(toscaNodeType);
268 if (created != null) {
269 sb.append(",created=");
270 sb.append(DateFormat.getInstance().format(created));
273 for(VnfResourceCustomization vrc : vnfResourceCustomizations) {
274 sb.append("/n").append(vrc.toString());
277 for(VfModule vfm : vfModules) {
278 sb.append("/n").append(vfm.toString());
280 return sb.toString();