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 org.openecomp.core.utilities.json.JsonUtil;
24 import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
25 import org.openecomp.sdc.versioning.dao.types.Version;
26 import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
28 import java.nio.ByteBuffer;
30 public class UploadDataEntity implements VersionableEntity {
31 private static final String ENTITY_TYPE = "Vendor Software Product Upload data";
35 private Version version;
37 private String packageName;
39 private String packageVersion;
41 private String validationData;
43 private ByteBuffer contentData;
45 public UploadDataEntity() {
48 public UploadDataEntity(String id, Version version) {
50 this.version = version;
54 public String getEntityType() {
59 public String getFirstClassCitizenId() {
63 public String getId() {
67 public void setId(String id) {
72 public Version getVersion() {
77 public void setVersion(Version version) {
78 this.version = version;
81 public String getPackageName() {
85 public void setPackageName(String packageName) {
86 this.packageName = packageName;
89 public String getPackageVersion() {
90 return packageVersion;
93 public void setPackageVersion(String packageVersion) {
94 this.packageVersion = packageVersion;
97 public String getValidationData() {
98 return validationData;
101 public void setValidationData(String validationData) {
102 this.validationData = validationData;
105 public ValidationStructureList getValidationDataStructure() {
106 return validationData == null ? null
107 : JsonUtil.json2Object(validationData, ValidationStructureList.class);
110 public void setValidationDataStructure(ValidationStructureList validationData) {
111 this.validationData = validationData == null ? null
112 : JsonUtil.object2Json(validationData);
115 public ByteBuffer getContentData() {
119 public void setContentData(ByteBuffer contentData) {
120 this.contentData = contentData;