6aac77acfab705da4e94dfce39356fdad3004e9f
[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 lombok.NoArgsConstructor;
27 import lombok.Data;
28 import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
29 import org.openecomp.sdc.versioning.dao.types.Version;
30
31 import java.nio.ByteBuffer;
32
33
34 @Data
35 @NoArgsConstructor
36 @Table(keyspace = "dox", name = "package_details")
37 public class PackageInfo {
38
39
40   @PartitionKey
41   @Column(name = "vsp_id")
42   private String vspId;
43
44   @PartitionKey(value = 1)
45   private String version;
46
47   @Column(name = "display_name")
48   private String displayName;
49
50   @Column(name = "vsp_name")
51   private String vspName;
52
53   @Column(name = "vsp_description")
54   private String vspDescription;
55
56   @Column(name = "vendor_name")
57   private String vendorName;
58
59   private String category;
60
61   @Column(name = "sub_category")
62   private String subCategory;
63
64   @Column(name = "vendor_release")
65   private String vendorRelease;
66
67   @Column(name = "package_checksum")
68   private String packageChecksum;
69
70   @Column(name = "package_type")
71   private String packageType;
72
73   @Column(name = "translate_content")
74   private ByteBuffer translatedFile;
75
76   @Column(name = "resource_type")
77   private String resourceType = ResourceTypeEnum.VF.name();
78
79   public PackageInfo(String packageId, Version version) {
80     this.vspId = packageId;
81     this.version = version.getName();
82   }
83 }