1bbe1b0ddfe75239d0cb99f41db9cc2f9d4f29e4
[sdc.git] /
1 /*
2  * Copyright © 2016-2018 European Support Limited
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
18
19 import org.openecomp.core.utilities.json.JsonUtil;
20 import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
21 import org.openecomp.sdc.versioning.dao.types.Version;
22 import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
23
24 import java.nio.ByteBuffer;
25
26 public class OrchestrationTemplateEntity implements VersionableEntity {
27   private static final String ENTITY_TYPE = "Vendor Software Product Orchestration Template";
28
29   private String id;
30   private Version version;
31   private String fileSuffix;
32   private String fileName;
33   private String packageName;
34   private String packageVersion;
35   private String validationData;
36   private ByteBuffer contentData;
37   private String filesDataStructure;
38
39   public OrchestrationTemplateEntity() {
40     //default constructor implementation is not provided for OrchestrationTemplateEntity
41   }
42
43   public OrchestrationTemplateEntity(String id, Version version) {
44     this.id = id;
45     this.version = version;
46   }
47
48   @Override
49   public String getEntityType() {
50     return ENTITY_TYPE;
51   }
52
53   @Override
54   public String getFirstClassCitizenId() {
55     return getId();
56   }
57
58   @Override
59   public String getId() {
60     return id;
61   }
62
63   @Override
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
136   public String getFilesDataStructure() {
137     return filesDataStructure;
138   }
139
140   public void setFilesDataStructure(String filesDataStructure) {
141     this.filesDataStructure = filesDataStructure;
142   }
143 }