push addional code
[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 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 import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
32
33 import java.util.List;
34
35 @Table(keyspace = "dox", name = "vsp_information")
36 public class VspDetails implements VersionableEntity {
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   @Computed("writetime(name)")
83   private Long writetimeMicroSeconds;
84
85   public VspDetails() {
86   }
87
88   public VspDetails(String id, Version version) {
89     this.id = id;
90     this.version = version;
91   }
92
93   @Override
94   public String getEntityType() {
95     return ENTITY_TYPE;
96   }
97
98   @Override
99   public String getFirstClassCitizenId() {
100     return getId();
101   }
102
103   public String getId() {
104     return id;
105   }
106
107   public void setId(String id) {
108     this.id = id;
109   }
110
111   @Override
112   public Version getVersion() {
113     return version;
114   }
115
116   @Override
117   public void setVersion(Version version) {
118     this.version = version;
119   }
120
121   public String getName() {
122     return name;
123   }
124
125   public void setName(String name) {
126     this.name = name;
127   }
128
129   public String getDescription() {
130     return description;
131   }
132
133   public void setDescription(String description) {
134     this.description = description;
135   }
136
137   public String getCategory() {
138     return category;
139   }
140
141   public void setCategory(String category) {
142     this.category = category;
143   }
144
145   public String getSubCategory() {
146     return subCategory;
147   }
148
149   public void setSubCategory(String subCategory) {
150     this.subCategory = subCategory;
151   }
152
153   public String getIcon() {
154     return icon;
155   }
156
157   public void setIcon(String icon) {
158     this.icon = icon;
159   }
160
161   public String getVendorName() {
162     return vendorName;
163   }
164
165   public void setVendorName(String vendorName) {
166     this.vendorName = vendorName;
167   }
168
169   public String getVendorId() {
170     return vendorId;
171   }
172
173   public void setVendorId(String vendorId) {
174     this.vendorId = vendorId;
175   }
176
177   public Version getVlmVersion() {
178     return vlmVersion;
179   }
180
181   public void setVlmVersion(Version vlmVersion) {
182     this.vlmVersion = vlmVersion;
183   }
184
185   public String getLicenseAgreement() {
186     return licenseAgreement;
187   }
188
189   public void setLicenseAgreement(String licenseAgreement) {
190     this.licenseAgreement = licenseAgreement;
191   }
192
193   public List<String> getFeatureGroups() {
194     return featureGroups;
195   }
196
197   public void setFeatureGroups(List<String> featureGroups) {
198     this.featureGroups = featureGroups;
199   }
200
201   public String getPackageName() {
202     return packageName;
203   }
204
205   public void setPackageName(String packageName) {
206     this.packageName = packageName;
207   }
208
209   public String getPackageVersion() {
210     return packageVersion;
211   }
212
213   public void setPackageVersion(String packageVersion) {
214     this.packageVersion = packageVersion;
215   }
216
217   public String getValidationData() {
218     return validationData;
219   }
220
221   public void setValidationData(String validationData) {
222     this.validationData = validationData;
223   }
224
225   public ValidationStructureList getValidationDataStructure() {
226     return validationData == null ? null
227         : JsonUtil.json2Object(validationData, ValidationStructureList.class);
228   }
229
230   public void setValidationDataStructure(ValidationStructureList validationData) {
231     this.validationData = validationData == null ? null
232         : JsonUtil.object2Json(validationData);
233   }
234
235   public Long getWritetimeMicroSeconds() {
236     return this.writetimeMicroSeconds;
237   }
238
239   public void setWritetimeMicroSeconds(Long writetimeMicroSeconds) {
240     this.writetimeMicroSeconds = writetimeMicroSeconds;
241   }
242 }