[MSO-8] Update the maven dependency
[so.git] / mso-catalog-db / src / main / java / org / openecomp / mso / db / catalog / beans / VnfResource.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * OPENECOMP - MSO
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20
21 package org.openecomp.mso.db.catalog.beans;
22
23
24 import java.sql.Timestamp;
25 import java.text.DateFormat;
26 import java.util.ArrayList;
27 import java.util.Map;
28
29 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
30
31 public class VnfResource extends MavenLikeVersioning {
32
33     private int id;
34     private String vnfType;
35
36     private String orchestrationMode = null;
37     private String description = null;
38     private Integer templateId;
39     private Integer environmentId = null;
40
41     private Map <String, HeatFiles> heatFiles;
42
43     private String asdcUuid;
44
45     private Timestamp created;
46
47     private String aicVersionMin = null;
48     private String aicVersionMax = null;
49
50     private String modelInvariantUuid = null;
51     private String modelVersion = null;
52
53     private String modelCustomizationName = null;
54
55     private String modelName = null;
56     private String serviceModelInvariantUUID = null;
57         private String modelCustomizationUuid = null;
58
59         private ArrayList<VfModule> vfModules;
60
61     public VnfResource () {
62                 super();
63                 this.vfModules = new ArrayList<VfModule>();
64     }
65
66     public int getId () {
67         return id;
68     }
69
70     public void setId (int id) {
71         this.id = id;
72     }
73
74     public String getVnfType () {
75         return vnfType;
76     }
77
78     public void setVnfType (String vnfType) {
79         this.vnfType = vnfType;
80     }
81
82     public String getOrchestrationMode () {
83         return orchestrationMode;
84     }
85
86     public void setOrchestrationMode (String orchestrationMode) {
87         this.orchestrationMode = orchestrationMode;
88     }
89
90     public String getDescription () {
91         return description;
92     }
93
94     public void setDescription (String description) {
95         this.description = description;
96     }
97
98     public Integer getTemplateId () {
99         return templateId;
100     }
101
102     public void setTemplateId (Integer templateId) {
103         this.templateId = templateId;
104     }
105
106     public Integer getEnvironmentId () {
107         return this.environmentId;
108     }
109
110     public void setEnvironmentId (Integer environmentId) {
111         this.environmentId = environmentId;
112     }
113
114     public Map <String, HeatFiles> getHeatFiles () {
115         return this.heatFiles;
116     }
117
118     public void setHeatFiles (Map <String, HeatFiles> heatFiles) {
119         this.heatFiles = heatFiles;
120     }
121
122         public String getAsdcUuid() {
123                 return asdcUuid;
124         }
125
126         public void setAsdcUuid(String asdcUuidp) {
127                 this.asdcUuid = asdcUuidp;
128         }
129
130         public Timestamp getCreated() {
131                 return created;
132         }
133
134         public void setCreated(Timestamp created) {
135                 this.created = created;
136         }
137
138         public String getAicVersionMin() {
139                 return this.aicVersionMin;
140         }
141
142         public void setAicVersionMin(String aicVersionMin) {
143                 this.aicVersionMin = aicVersionMin;
144         }
145
146         public String getAicVersionMax() {
147                 return this.aicVersionMax;
148         }
149
150         public void setAicVersionMax(String aicVersionMax) {
151                 this.aicVersionMax = aicVersionMax;
152         }
153
154         public String getModelInvariantUuid() {
155                 return this.modelInvariantUuid;
156         }
157
158         public void setModelInvariantUuid(String modelInvariantUuid) {
159                 this.modelInvariantUuid = modelInvariantUuid;
160         }
161
162         public String getModelVersion() {
163                 return this.modelVersion;
164         }
165         public void setModelVersion(String modelVersion) {
166                 this.modelVersion = modelVersion;
167         }
168
169         public String getModelCustomizationName() {
170                 return modelCustomizationName;
171         }
172
173         public void setModelCustomizationName(String modelCustomizationName) {
174                 this.modelCustomizationName = modelCustomizationName;
175         }
176
177         public String getModelName() {
178                 return modelName;
179         }
180
181         public void setModelName(String modelName) {
182                 this.modelName = modelName;
183         }
184
185         public String getServiceModelInvariantUUID() {
186                 return serviceModelInvariantUUID;
187         }
188
189         public void setServiceModelInvariantUUID(String serviceModelInvariantUUID) {
190                 this.serviceModelInvariantUUID = serviceModelInvariantUUID;
191         }
192
193         public String getModelCustomizationUuid() {
194                 return this.modelCustomizationUuid;
195         }
196         public void setModelCustomizationUuid(String modelCustomizationUuid) {
197                 this.modelCustomizationUuid = modelCustomizationUuid;
198         }
199
200         public ArrayList<VfModule> getVfModules() {
201                 return this.vfModules;
202         }
203         public void setVfModules(ArrayList<VfModule> vfModules) {
204                 this.vfModules = vfModules;
205         }
206         public void addVfModule(VfModule vfm) {
207                 if (vfm != null) {
208                         if (this.vfModules != null) {
209                                 this.vfModules.add(vfm);
210                         } else {
211                                 this.vfModules = new ArrayList<VfModule>();
212                                 this.vfModules.add(vfm);
213                         }
214                 }
215         }
216         @Override
217         public String toString () {
218                 StringBuffer buf = new StringBuffer();
219
220                 buf.append("VNF=");
221                 buf.append(vnfType);
222                 buf.append(",version=");
223                 buf.append(version);
224                 buf.append(",mode=");
225                 buf.append(orchestrationMode);
226                 buf.append(",template=");
227                 buf.append(templateId);
228                 buf.append(",envtId=");
229                 buf.append(environmentId);
230                 buf.append(",asdcUuid=");
231                 buf.append(asdcUuid);
232                 buf.append(",aicVersionMin=");
233                 buf.append(this.aicVersionMin);
234                 buf.append(",aicVersionMax=");
235                 buf.append(this.aicVersionMax);
236         buf.append(",modelInvariantUuid=");
237         buf.append(this.modelInvariantUuid);
238         buf.append(",modelVersion=");
239         buf.append(this.modelVersion);
240         buf.append(",modelCustomizationName=");
241         buf.append(this.modelCustomizationName);
242         buf.append(",modelName=");
243         buf.append(this.modelName);
244         buf.append(",serviceModelInvariantUUID=");
245         buf.append(this.serviceModelInvariantUUID);
246                 buf.append(",modelCustomizationUuid=");
247                 buf.append(this.modelCustomizationUuid);
248
249                 if (created != null) {
250                         buf.append(",created=");
251                         buf.append(DateFormat.getInstance().format(created));
252                 }
253                 if (this.vfModules != null && this.vfModules.size() > 0) {
254                         buf.append("VfModules:");
255                         int i=0;
256                         for (VfModule vfm : this.vfModules) {
257                                 buf.append("vfModule[" + i++ + "]:" + vfm.toString());
258                         }
259                 } else {
260                         buf.append("VfModules: NONE");
261                 }
262                 return buf.toString();
263     }
264
265 }