push addional code
[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 / VspQuestionnaireEntity.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.vendorsoftwareproduct.types.composition.CompositionEntityId;
28 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
29 import org.openecomp.sdc.versioning.dao.types.Version;
30
31 @Table(keyspace = "dox", name = "vsp_information")
32 public class VspQuestionnaireEntity implements CompositionEntity {
33   private static final String ENTITY_TYPE = "Vendor Software Product";
34
35   @PartitionKey
36   @Column(name = "vsp_id")
37   private String id;
38   @PartitionKey(value = 1)
39   @Frozen
40   private Version version;
41   @Column(name = "questionnaire_data")
42   private String questionnaireData;
43
44   public VspQuestionnaireEntity() {
45
46   }
47
48   public VspQuestionnaireEntity(String vspId, Version version) {
49     this.id = vspId;
50     this.version = version;
51   }
52
53   @Override
54   public String getId() {
55     return id;
56   }
57
58   @Override
59   public void setId(String id) {
60     this.id = id;
61   }
62
63   @Override
64   public Version getVersion() {
65     return version;
66   }
67
68   @Override
69   public void setVersion(Version version) {
70     this.version = version;
71   }
72
73   @Override
74   public String getEntityType() {
75     return ENTITY_TYPE;
76   }
77
78   @Override
79   public String getFirstClassCitizenId() {
80     return getId();
81   }
82
83   @Override
84   public CompositionEntityType getType() {
85     return CompositionEntityType.vsp;
86   }
87
88   @Override
89   public CompositionEntityId getCompositionEntityId() {
90     return new CompositionEntityId(getId(), null);
91   }
92
93   @Override
94   public String getCompositionData() {
95     return null; //none
96   }
97
98   @Override
99   public void setCompositionData(String compositionData) {
100     //none
101   }
102
103   public String getQuestionnaireData() {
104     return questionnaireData;
105   }
106
107   public void setQuestionnaireData(String questionnaireData) {
108     this.questionnaireData = questionnaireData;
109   }
110
111 }