abd3e2decfefe9804262e9705ba65bce450bd51a
[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 com.datastax.driver.mapping.annotations.Column;
24 import com.datastax.driver.mapping.annotations.PartitionKey;
25 import com.datastax.driver.mapping.annotations.Table;
26 import org.openecomp.sdc.versioning.dao.types.Version;
27
28 import java.nio.ByteBuffer;
29
30
31 @Table(keyspace = "dox", name = "package_details")
32 public class PackageInfo {
33
34
35   @PartitionKey
36   @Column(name = "vsp_id")
37   private String vspId;
38
39   @PartitionKey(value = 1)
40   private String version;
41
42   @Column(name = "display_name")
43   private String displayName;
44
45   @Column(name = "vsp_name")
46   private String vspName;
47
48   @Column(name = "vsp_description")
49   private String vspDescription;
50
51   @Column(name = "vendor_name")
52   private String vendorName;
53
54   private String category;
55
56   @Column(name = "sub_category")
57   private String subCategory;
58
59   @Column(name = "vendor_release")
60   private String vendorRelease;
61
62   @Column(name = "package_checksum")
63   private String packageChecksum;
64
65   @Column(name = "package_type")
66   private String packageType;
67
68   @Column(name = "translate_content")
69   private ByteBuffer translatedFile;
70
71   /**
72    * Every entity class must have a default constructor according to
73    * <a href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/object_mapper/creating/">
74    * Definition of mapped classes</a>.
75    */
76   public PackageInfo() {
77     // Don't delete! Default constructor is required by DataStax driver
78   }
79
80   public PackageInfo(String packageId, Version version) {
81     this.vspId = packageId;
82     this.version = version.getName();
83   }
84
85   public String getDisplayName() {
86     return displayName;
87   }
88
89   public void setDisplayName(String displayName) {
90     this.displayName = displayName;
91   }
92
93   public String getVspDescription() {
94     return vspDescription;
95   }
96
97   public void setVspDescription(String vspDescription) {
98     this.vspDescription = vspDescription;
99   }
100
101   public String getVersion() {
102     return version;
103   }
104
105   public void setVersion(String version) {
106     this.version = version;
107   }
108
109   public String getVspId() {
110     return vspId;
111   }
112
113   public void setVspId(String vspId) {
114     this.vspId = vspId;
115   }
116
117   public String getCategory() {
118     return category;
119   }
120
121   public void setCategory(String category) {
122     this.category = category;
123   }
124
125   public String getSubCategory() {
126     return subCategory;
127   }
128
129   public void setSubCategory(String subCategory) {
130     this.subCategory = subCategory;
131   }
132
133   public String getVendorName() {
134     return vendorName;
135   }
136
137   public void setVendorName(String vendorName) {
138     this.vendorName = vendorName;
139   }
140
141   public String getVendorRelease() {
142     return vendorRelease;
143   }
144
145   public void setVendorRelease(String vendorRelease) {
146     this.vendorRelease = vendorRelease;
147   }
148
149   public String getPackageChecksum() {
150     return packageChecksum;
151   }
152
153   public void setPackageChecksum(String packageChecksum) {
154     this.packageChecksum = packageChecksum;
155   }
156
157   public String getPackageType() {
158     return packageType;
159   }
160
161   public void setPackageType(String packageType) {
162     this.packageType = packageType;
163   }
164
165   public ByteBuffer getTranslatedFile() {
166     return translatedFile;
167   }
168
169   public void setTranslatedFile(ByteBuffer translatedFile) {
170     this.translatedFile = translatedFile;
171   }
172
173   public String getVspName() {
174     return vspName;
175   }
176
177   public void setVspName(String vendorName) {
178     this.vspName = vendorName;
179   }
180 }