2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
23 import com.datastax.driver.mapping.annotations.Column;
24 import com.datastax.driver.mapping.annotations.Frozen;
25 import com.datastax.driver.mapping.annotations.PartitionKey;
26 import com.datastax.driver.mapping.annotations.Table;
27 import org.openecomp.core.utilities.json.JsonUtil;
28 import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
29 import org.openecomp.sdc.versioning.dao.types.Version;
30 import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
32 import java.nio.ByteBuffer;
34 @Table(keyspace = "dox", name = "vsp_information")
35 public class UploadDataEntity implements VersionableEntity {
36 private static final String ENTITY_TYPE = "Vendor Software Product Upload data";
39 @Column(name = "vsp_id")
42 @PartitionKey(value = 1)
44 private Version version;
46 @Column(name = "package_name")
47 private String packageName;
49 @Column(name = "package_version")
50 private String packageVersion;
52 @Column(name = "validation_data")
53 private String validationData;
55 @Column(name = "content_data")
56 private ByteBuffer contentData;
58 public UploadDataEntity() {
61 public UploadDataEntity(String id, Version version) {
63 this.version = version;
67 public String getEntityType() {
72 public String getFirstClassCitizenId() {
76 public String getId() {
80 public void setId(String id) {
85 public Version getVersion() {
90 public void setVersion(Version version) {
91 this.version = version;
94 public String getPackageName() {
98 public void setPackageName(String packageName) {
99 this.packageName = packageName;
102 public String getPackageVersion() {
103 return packageVersion;
106 public void setPackageVersion(String packageVersion) {
107 this.packageVersion = packageVersion;
110 public String getValidationData() {
111 return validationData;
114 public void setValidationData(String validationData) {
115 this.validationData = validationData;
118 public ValidationStructureList getValidationDataStructure() {
119 return validationData == null ? null
120 : JsonUtil.json2Object(validationData, ValidationStructureList.class);
123 public void setValidationDataStructure(ValidationStructureList validationData) {
124 this.validationData = validationData == null ? null
125 : JsonUtil.object2Json(validationData);
128 public ByteBuffer getContentData() {
132 public void setContentData(ByteBuffer contentData) {
133 this.contentData = contentData;