Merge "Update .gitreview with onap URL"
[so.git] / mso-catalog-db / src / main / java / org / openecomp / mso / db / catalog / beans / VfModule.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
25 import java.sql.Timestamp;
26 import java.text.DateFormat;
27
28 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
29
30 public class VfModule extends MavenLikeVersioning {
31
32         private int id;
33         private Integer vnfResourceId;
34         private String type;
35         private String modelName;
36         private int isBase;
37         private Integer templateId;
38         private Integer environmentId;
39         private Integer volTemplateId;
40         private Integer volEnvironmentId;
41         private String description;
42         private String asdcUuid;
43     private Timestamp created;
44     private String modelInvariantUuid;
45     private String modelVersion;
46         private String modelCustomizationUuid = null;
47         private Integer minInstances;
48         private Integer maxInstances;
49         private Integer initialCount;
50         private String label;
51         private String modelUuid;
52
53     public VfModule() {
54                 super();
55         }
56
57         public int getId(){
58                 return this.id;
59         }
60         public void setId(int id) {
61                 this.id = id;
62         }
63
64         public Integer getVnfResourceId() {
65                 return this.vnfResourceId;
66         }
67         public void setVnfResourceId(Integer vnfResourceId) {
68                 this.vnfResourceId = vnfResourceId;
69         }
70
71         public String getModelName() {
72                 return this.modelName;
73         }
74         public void setModelName(String modelName) {
75                 this.modelName = modelName;
76         }
77
78         public String getType() {
79                 return type;
80         }
81
82         public void setType(String type) {
83                 this.type = type;
84         }
85
86         public int getIsBase() {
87                 return this.isBase;
88         }
89         public void setIsBase(int isBase) {
90                 this.isBase = isBase;
91         }
92         public boolean isBase() {
93                 if (this.isBase == 0) {
94                         return false;
95                 } else {
96                         return true;
97                 }
98         }
99
100         public Integer getTemplateId() {
101                 return this.templateId;
102         }
103         public void setTemplateId(Integer templateId) {
104                 this.templateId = templateId;
105         }
106
107         public Integer getEnvironmentId() {
108                 return this.environmentId;
109         }
110         public void setEnvironmentId(Integer environmentId) {
111                 this.environmentId = environmentId;
112         }
113
114         public Integer getVolTemplateId() {
115                 return this.volTemplateId;
116         }
117         public void setVolTemplateId(Integer volTemplateId) {
118                 this.volTemplateId = volTemplateId;
119         }
120
121         public Integer getVolEnvironmentId() {
122                 return this.volEnvironmentId;
123         }
124         public void setVolEnvironmentId(Integer volEnvironmentId) {
125                 this.volEnvironmentId = volEnvironmentId;
126         }
127
128         public String getDescription() {
129                 return this.description;
130         }
131         public void setDescription(String description) {
132                 this.description = description;
133         }
134
135         public String getAsdcUuid() {
136                 return asdcUuid;
137         }
138
139         public void setAsdcUuid(String asdcUuidp) {
140                 this.asdcUuid = asdcUuidp;
141         }
142
143         public Timestamp getCreated() {
144                 return created;
145         }
146
147         public void setCreated(Timestamp created) {
148                 this.created = created;
149         }
150         public String getModelInvariantUuid() {
151                 return this.modelInvariantUuid;
152         }
153         public void setModelInvariantUuid(String modelInvariantUuid) {
154                 this.modelInvariantUuid = modelInvariantUuid;
155         }
156
157
158         public String getModelVersion() {
159                 return this.modelVersion;
160         }
161         public void setModelVersion(String modelVersion) {
162                 this.modelVersion = modelVersion;
163         }
164         public String getModelCustomizationUuid() {
165                 return this.modelCustomizationUuid;
166         }
167         public void setModelCustomizationUuid(String modelCustomizationUuid) {
168                 this.modelCustomizationUuid = modelCustomizationUuid;
169         }
170         public Integer getMinInstances() {
171                 return this.minInstances;
172         }
173         public void setMinInstances(Integer minInstances) {
174                 this.minInstances = minInstances;
175         }
176         public Integer getMaxInstances() {
177                 return this.maxInstances;
178         }
179         public void setMaxInstances(Integer maxInstances) {
180                 this.maxInstances = maxInstances;
181         }
182         public Integer getInitialCount() {
183                 return this.initialCount;
184         }
185         public void setInitialCount(Integer initialCount) {
186                 this.initialCount = initialCount;
187         }
188         public String getLabel() {
189                 return this.label;
190         }
191         public void setLabel(String label) {
192                 this.label = label;
193         }
194
195         // Will be fixed pending finalizing of 1707 catalog db schema changes
196         public void setModelUuid(String modelUuid) {
197                 this.modelUuid = modelUuid;
198         }
199         public String getModelUuid() {
200                 return this.modelUuid;
201         }
202         public String getModelInvariantId() {
203                 return this.modelInvariantUuid;
204         }
205         public String getVfModuleType() {
206                 return this.type;
207         }
208         public String getVfModuleLabel() {
209                 return this.label;
210         }
211
212         @Override
213         public String toString () {
214        StringBuffer buf = new StringBuffer();
215
216        buf.append("VF=");
217        buf.append(this.type);
218        buf.append(",modelName=");
219        buf.append(modelName);
220        buf.append(",version=");
221        buf.append(version);
222        buf.append(",id=");
223        buf.append(this.id);
224        buf.append(",vnfResourceId=");
225        buf.append(this.vnfResourceId);
226        buf.append(",templateId=");
227        buf.append(this.templateId);
228        buf.append(",envtId=");
229        buf.append(this.environmentId);
230        buf.append(",volTemplateId=");
231        buf.append(this.volTemplateId);
232        buf.append(",volEnvtId=");
233        buf.append(this.volEnvironmentId);
234        buf.append(", description=");
235        buf.append(this.description);
236        buf.append(",asdcUuid=");
237        buf.append(asdcUuid);
238        buf.append(",modelVersion=");
239        buf.append(this.modelVersion);
240        buf.append(",modelCustomizationUuid=");
241        buf.append(this.modelCustomizationUuid);
242        buf.append(",minInstances=");
243        buf.append(this.minInstances);
244        buf.append(",maxInstances=");
245        buf.append(this.maxInstances);
246        buf.append(",initialCount=");
247        buf.append(this.initialCount);
248        buf.append(",label=");
249        buf.append(this.label);
250
251          if (this.created != null) {
252                  buf.append (",created=");
253                  buf.append (DateFormat.getInstance().format(this.created));
254          }
255         return buf.toString();
256     }
257
258 }