Create new VSP, onboard from TOSCA file - UI
[sdc.git] / openecomp-be / lib / openecomp-sdc-vendor-software-product-lib / openecomp-sdc-vendor-software-product-api / src / main / java / org / openecomp / sdc / vendorsoftwareproduct / dao / type / VspDetails.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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.sdc.vendorsoftwareproduct.dao.type;
22
23 import org.openecomp.core.utilities.json.JsonUtil;
24 import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
25 import org.openecomp.sdc.versioning.dao.types.Version;
26 import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
27
28 import java.util.List;
29
30
31 public class VspDetails implements VersionableEntity {
32   public static final String ENTITY_TYPE = "Vendor Software Product";
33
34   private String id;
35
36   private Version version;
37
38   private String name;
39   private String description;
40
41   private String category;
42
43   private String subCategory;
44
45   private String icon;
46
47   private String vendorName;
48
49   private String vendorId;
50
51   private Version vlmVersion;
52
53   private String licenseAgreement;
54
55   private List<String> featureGroups;
56
57   private String validationData;
58
59   private String oldVersion;
60
61   private Long writetimeMicroSeconds;
62
63   private String onboardingMethod;
64
65   private String onboardingOrigin;
66
67   private String networkPackageName;
68
69   public VspDetails() {
70   }
71
72   public VspDetails(String id, Version version) {
73     this.id = id;
74     this.version = version;
75   }
76
77   @Override
78   public String getEntityType() {
79     return ENTITY_TYPE;
80   }
81
82   @Override
83   public String getFirstClassCitizenId() {
84     return getId();
85   }
86
87   public String getId() {
88     return id;
89   }
90
91   public void setId(String id) {
92     this.id = id;
93   }
94
95   @Override
96   public Version getVersion() {
97     return version;
98   }
99
100   @Override
101   public void setVersion(Version version) {
102     this.version = version;
103   }
104
105   public String getName() {
106     return name;
107   }
108
109   public void setName(String name) {
110     this.name = name;
111   }
112
113   public String getDescription() {
114     return description;
115   }
116
117   public void setDescription(String description) {
118     this.description = description;
119   }
120
121   public String getCategory() {
122     return category;
123   }
124
125   public void setCategory(String category) {
126     this.category = category;
127   }
128
129   public String getSubCategory() {
130     return subCategory;
131   }
132
133   public void setSubCategory(String subCategory) {
134     this.subCategory = subCategory;
135   }
136
137   public String getIcon() {
138     return icon;
139   }
140
141   public void setIcon(String icon) {
142     this.icon = icon;
143   }
144
145   public String getVendorName() {
146     return vendorName;
147   }
148
149   public void setVendorName(String vendorName) {
150     this.vendorName = vendorName;
151   }
152
153   public String getVendorId() {
154     return vendorId;
155   }
156
157   public void setVendorId(String vendorId) {
158     this.vendorId = vendorId;
159   }
160
161   public Version getVlmVersion() {
162     return vlmVersion;
163   }
164
165   public void setVlmVersion(Version vlmVersion) {
166     this.vlmVersion = vlmVersion;
167   }
168
169   public String getLicenseAgreement() {
170     return licenseAgreement;
171   }
172
173   public void setLicenseAgreement(String licenseAgreement) {
174     this.licenseAgreement = licenseAgreement;
175   }
176
177   public List<String> getFeatureGroups() {
178     return featureGroups;
179   }
180
181   public void setFeatureGroups(List<String> featureGroups) {
182     this.featureGroups = featureGroups;
183   }
184
185   public String getValidationData() {
186     return validationData;
187   }
188
189   public void setValidationData(String validationData) {
190     this.validationData = validationData;
191   }
192
193   public ValidationStructureList getValidationDataStructure() {
194     return validationData == null ? null
195         : JsonUtil.json2Object(validationData, ValidationStructureList.class);
196   }
197
198   public void setValidationDataStructure(ValidationStructureList validationData) {
199     this.validationData = validationData == null ? null
200         : JsonUtil.object2Json(validationData);
201   }
202
203   public Long getWritetimeMicroSeconds() {
204     return this.writetimeMicroSeconds;
205   }
206
207   public void setWritetimeMicroSeconds(Long writetimeMicroSeconds) {
208     this.writetimeMicroSeconds = writetimeMicroSeconds;
209   }
210
211   /*public boolean isOldVersion() {
212     return this.oldVersion;
213   }*/
214
215   public String getOldVersion(){
216     return this.oldVersion;
217   }
218
219   public void setOldVersion(String oldVersion) {
220     this.oldVersion = oldVersion;
221   }
222
223   public String getOnboardingOrigin() {
224     return onboardingOrigin;
225   }
226
227   public void setOnboardingOrigin(String onboardingOrigin) {
228     this.onboardingOrigin = onboardingOrigin;
229   }
230
231   public String getOnboardingMethod() {
232     return onboardingMethod;
233   }
234   public void setOnboardingMethod(String onboardingMethod) {
235     this.onboardingMethod = onboardingMethod;
236   }
237
238   public String getNetworkPackageName() {
239     return networkPackageName;
240   }
241
242   public void setNetworkPackageName(String networkPackageName) {
243     this.networkPackageName = networkPackageName;
244   }
245
246   @Override
247   public String toString() {
248     return String.format(
249         "Vsp id = '%s', Version = %s', Name = %s', Category = %s', Description = %s', Vendor = %s'",
250         this.id, this.version, this.name, this.category, this.description, this.vendorName);
251   }
252 }