[SDC-29] Amdocs OnBoard 1707 initial commit.
[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 / OrchestrationTemplateCandidateDataEntity.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 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.sdc.versioning.dao.types.Version;
28 import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
29
30 import java.nio.ByteBuffer;
31
32 @Table(keyspace = "dox", name = "vsp_orchestration_template_candidate")
33 public class OrchestrationTemplateCandidateDataEntity implements VersionableEntity {
34   private static final String ENTITY_TYPE =
35       "Vendor Software Product Upload Orchestration_candidate data";
36
37   @PartitionKey
38   @Column(name = "vsp_id")
39   private String id;
40
41   @PartitionKey(value = 1)
42   @Frozen
43   private Version version;
44
45   @Column(name = "content_data")
46   private ByteBuffer contentData;
47
48   @Column(name = "files_data_structure")
49   private String filesDataStructure;
50
51   public OrchestrationTemplateCandidateDataEntity() {
52   }
53
54   /**
55    * Instantiates a new OrchestrationTemplateCandidateDataEntity.
56    *
57    * @param id       the id
58    * @param version     the Version
59
60    */
61   public OrchestrationTemplateCandidateDataEntity(String id, Version version) {
62     this.id = id;
63     this.version = version;
64   }
65
66   /**
67    * Instantiates a new OrchestrationTemplateCandidateDataEntity.
68    *
69    * @param filesDataStructure       the files data Structure
70    * @param version     the version
71    * @param contentData the contentData
72    * @param id          the id
73    */
74   public OrchestrationTemplateCandidateDataEntity(String id, Version version,
75                                                   ByteBuffer contentData,
76                                                   String filesDataStructure) {
77     this.id = id;
78     this.contentData = contentData;
79     this.filesDataStructure = filesDataStructure;
80     this.version = version;
81   }
82
83   @Override
84   public String getEntityType() {
85     return ENTITY_TYPE;
86   }
87
88   @Override
89   public String getFirstClassCitizenId() {
90     return null;
91   }
92
93   public String getId() {
94     return id;
95   }
96
97   public void setId(String id) {
98     this.id = id;
99   }
100
101   @Override
102   public Version getVersion() {
103     return version;
104   }
105
106   @Override
107   public void setVersion(Version version) {
108     this.version = version;
109   }
110
111   public ByteBuffer getContentData() {
112     return contentData;
113   }
114
115   public void setContentData(ByteBuffer contentData) {
116     this.contentData = contentData;
117   }
118
119   public String getFilesDataStructure() {
120     return filesDataStructure;
121   }
122
123   public void setFilesDataStructure(String filesDataStructure) {
124     this.filesDataStructure = filesDataStructure;
125   }
126 }