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