fix incorrect dependency
[sdc.git] / openecomp-be / tools / migration / 1702_to_1707_zusammen / src / main / java / org / openecomp / core / migration / loaders / VspInformation.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.core.migration.loaders;
22
23 import com.datastax.driver.mapping.annotations.Column;
24 import com.datastax.driver.mapping.annotations.Computed;
25 import com.datastax.driver.mapping.annotations.Frozen;
26 import com.datastax.driver.mapping.annotations.PartitionKey;
27 import com.datastax.driver.mapping.annotations.Table;
28 import org.openecomp.core.utilities.json.JsonUtil;
29 import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
30 import org.openecomp.sdc.versioning.dao.types.Version;
31
32 import java.nio.ByteBuffer;
33 import java.util.List;
34
35 @Table(keyspace = "dox", name = "vsp_information")
36 public class VspInformation {
37   public static final String ENTITY_TYPE = "Vendor Software Product";
38
39   @PartitionKey
40   @Column(name = "vsp_id")
41   private String id;
42
43   @PartitionKey(value = 1)
44   @Frozen
45   private Version version;
46
47   private String name;
48   private String description;
49
50   private String category;
51
52   @Column(name = "sub_category")
53   private String subCategory;
54
55   private String icon;
56
57   @Column(name = "vendor_name")
58   private String vendorName;
59
60   @Column(name = "vendor_id")
61   private String vendorId;
62
63   @Column(name = "vlm_version")
64   @Frozen
65   private Version vlmVersion;
66
67   @Column(name = "license_agreement")
68   private String licenseAgreement;
69
70   @Column(name = "feature_groups")
71   private List<String> featureGroups;
72
73   @Column(name = "package_name")
74   private String packageName;
75
76   @Column(name = "package_version")
77   private String packageVersion;
78
79   @Column(name = "validation_data")
80   private String validationData;
81
82   @Column(name = "is_old_version")
83   private String isOldVersion;
84
85   @Column(name = "questionnaire_data")
86   private String questionnaireData;
87
88   @Column(name = "content_data")
89   private ByteBuffer contentData;
90
91
92   @Computed("writetime(name)")
93   private Long writetimeMicroSeconds;
94
95
96   public VspInformation() {
97   }
98
99   public VspInformation(String id, Version version) {
100     this.id = id;
101     this.version = version;
102   }
103
104
105   public String getId() {
106     return id;
107   }
108
109   public void setId(String id) {
110     this.id = id;
111   }
112
113
114   public String getName() {
115     return name;
116   }
117
118   public void setName(String name) {
119     this.name = name;
120   }
121
122   public String getDescription() {
123     return description;
124   }
125
126   public void setDescription(String description) {
127     this.description = description;
128   }
129
130   public String getCategory() {
131     return category;
132   }
133
134   public void setCategory(String category) {
135     this.category = category;
136   }
137
138   public String getSubCategory() {
139     return subCategory;
140   }
141
142   public void setSubCategory(String subCategory) {
143     this.subCategory = subCategory;
144   }
145
146   public String getIcon() {
147     return icon;
148   }
149
150   public void setIcon(String icon) {
151     this.icon = icon;
152   }
153
154   public String getVendorName() {
155     return vendorName;
156   }
157
158   public void setVendorName(String vendorName) {
159     this.vendorName = vendorName;
160   }
161
162   public String getVendorId() {
163     return vendorId;
164   }
165
166   public void setVendorId(String vendorId) {
167     this.vendorId = vendorId;
168   }
169
170   public Version getVlmVersion() {
171     return vlmVersion;
172   }
173
174   public void setVlmVersion(Version vlmVersion) {
175     this.vlmVersion = vlmVersion;
176   }
177
178   public String getLicenseAgreement() {
179     return licenseAgreement;
180   }
181
182   public void setLicenseAgreement(String licenseAgreement) {
183     this.licenseAgreement = licenseAgreement;
184   }
185
186   public List<String> getFeatureGroups() {
187     return featureGroups;
188   }
189
190   public void setFeatureGroups(List<String> featureGroups) {
191     this.featureGroups = featureGroups;
192   }
193
194   public String getPackageName() {
195     return packageName;
196   }
197
198   public void setPackageName(String packageName) {
199     this.packageName = packageName;
200   }
201
202   public String getPackageVersion() {
203     return packageVersion;
204   }
205
206   public void setPackageVersion(String packageVersion) {
207     this.packageVersion = packageVersion;
208   }
209
210   public String getValidationData() {
211     return validationData;
212   }
213
214   public void setValidationData(String validationData) {
215     this.validationData = validationData;
216   }
217
218   public ValidationStructureList getValidationDataStructure() {
219     return validationData == null ? null
220         : JsonUtil.json2Object(validationData, ValidationStructureList.class);
221   }
222
223   public void setValidationDataStructure(ValidationStructureList validationData) {
224     this.validationData = validationData == null ? null
225         : JsonUtil.object2Json(validationData);
226   }
227
228   public Long getWritetimeMicroSeconds() {
229     return this.writetimeMicroSeconds;
230   }
231
232   public void setWritetimeMicroSeconds(Long writetimeMicroSeconds) {
233     this.writetimeMicroSeconds = writetimeMicroSeconds;
234   }
235
236   public String getIsOldVersion() {
237     return this.isOldVersion;
238   }
239
240   public void setIsOldVersion(String oldVersion) {
241     this.isOldVersion = oldVersion;
242   }
243
244   public void setVersion(Version version) {
245     this.version = version;
246   }
247
248   public Version getVersion() {
249     return version;
250   }
251
252   public String getQuestionnaireData() {
253     return questionnaireData;
254   }
255
256   public void setQuestionnaireData(String questionnaireData) {
257     this.questionnaireData = questionnaireData;
258   }
259
260   public ByteBuffer getContentData() {
261     return contentData;
262   }
263
264   public void setContentData(ByteBuffer contentData) {
265     this.contentData = contentData;
266   }
267
268   @Override
269   public String toString() {
270     StringBuilder sb = new StringBuilder();
271     sb.append("Vsp id = ").append(this.id);
272     sb.append("Version = ").append(this.version);
273
274     return sb.toString();
275   }
276 }