Add collaboration feature
[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 / OrchestrationTemplateEntity.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 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;
27
28 import java.nio.ByteBuffer;
29
30 public class OrchestrationTemplateEntity implements VersionableEntity {
31   private static final String ENTITY_TYPE = "Vendor Software Product Orchestration Template";
32
33   private String id;
34   private Version version;
35   private String fileSuffix;
36   private String fileName;
37   private String packageName;
38   private String packageVersion;
39   private String validationData;
40   private ByteBuffer contentData;
41
42   public OrchestrationTemplateEntity() {
43   }
44
45   public OrchestrationTemplateEntity(String id, Version version) {
46     this.id = id;
47     this.version = version;
48   }
49
50   @Override
51   public String getEntityType() {
52     return ENTITY_TYPE;
53   }
54
55   @Override
56   public String getFirstClassCitizenId() {
57     return getId();
58   }
59
60   public String getId() {
61     return id;
62   }
63
64   public void setId(String id) {
65     this.id = id;
66   }
67
68   @Override
69   public Version getVersion() {
70     return version;
71   }
72
73   @Override
74   public void setVersion(Version version) {
75     this.version = version;
76   }
77
78   public String getFileSuffix() {
79     return fileSuffix;
80   }
81
82   public void setFileSuffix(String fileSuffix) {
83     this.fileSuffix = fileSuffix;
84   }
85
86   public String getFileName() {
87     return fileName;
88   }
89
90   public void setFileName(String fileName) {
91     this.fileName = fileName;
92   }
93
94   public String getPackageName() {
95     return packageName;
96   }
97
98   public void setPackageName(String packageName) {
99     this.packageName = packageName;
100   }
101
102   public String getPackageVersion() {
103     return packageVersion;
104   }
105
106   public void setPackageVersion(String packageVersion) {
107     this.packageVersion = packageVersion;
108   }
109
110   public String getValidationData() {
111     return validationData;
112   }
113
114   public void setValidationData(String validationData) {
115     this.validationData = validationData;
116   }
117
118   public ValidationStructureList getValidationDataStructure() {
119     return validationData == null ? null
120         : JsonUtil.json2Object(validationData, ValidationStructureList.class);
121   }
122
123   public void setValidationDataStructure(ValidationStructureList validationData) {
124     this.validationData = validationData == null ? null
125         : JsonUtil.object2Json(validationData);
126   }
127
128   public ByteBuffer getContentData() {
129     return contentData;
130   }
131
132   public void setContentData(ByteBuffer contentData) {
133     this.contentData = contentData;
134   }
135 }