[sdc] docker file fix for cassandra
[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 / ProcessArtifactEntity.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.ClusteringColumn;
24 import com.datastax.driver.mapping.annotations.Column;
25 import com.datastax.driver.mapping.annotations.Frozen;
26 import com.datastax.driver.mapping.annotations.PartitionKey;
27 import com.datastax.driver.mapping.annotations.Table;
28 import org.openecomp.sdc.versioning.dao.types.Version;
29 import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
30
31 import java.nio.ByteBuffer;
32
33 @Table(keyspace = "dox", name = "vsp_process")
34 public class ProcessArtifactEntity implements VersionableEntity {
35   public static final String ENTITY_TYPE = "Vendor Software Product Process artifact";
36   @PartitionKey
37   @Column(name = "vsp_id")
38   private String vspId;
39   @PartitionKey(value = 1)
40   @Frozen
41   private Version version;
42   @ClusteringColumn
43   @Column(name = "component_id")
44   private String componentId;
45   @ClusteringColumn(value = 1)
46   @Column(name = "process_id")
47   private String id;
48   @Column(name = "artifact_name")
49   private String artifactName;
50   private ByteBuffer artifact;
51
52   public ProcessArtifactEntity() {
53
54   }
55
56   /**
57    * Instantiates a new Process artifact entity.
58    *
59    * @param vspId       the vsp id
60    * @param version     the version
61    * @param componentId the component id
62    * @param id          the id
63    */
64   public ProcessArtifactEntity(String vspId, Version version, String componentId, String id) {
65     this.vspId = vspId;
66     this.version = version;
67     this.componentId = componentId;
68     this.id = id;
69   }
70
71   public String getVspId() {
72     return vspId;
73   }
74
75   public void setVspId(String vspId) {
76     this.vspId = vspId;
77   }
78
79   public Version getVersion() {
80     return version;
81   }
82
83   public void setVersion(Version version) {
84     this.version = version;
85   }
86
87   public String getComponentId() {
88     return componentId;
89   }
90
91   public void setComponentId(String componentId) {
92     this.componentId = componentId;
93   }
94
95   @Override
96   public String getEntityType() {
97     return ENTITY_TYPE;
98   }
99
100   @Override
101   public String getFirstClassCitizenId() {
102     return getVspId();
103   }
104
105   public String getId() {
106     return id;
107   }
108
109   public void setId(String id) {
110     this.id = id;
111   }
112
113   public String getArtifactName() {
114     return artifactName;
115   }
116
117   public void setArtifactName(String artifactName) {
118     this.artifactName = artifactName;
119   }
120
121   public ByteBuffer getArtifact() {
122     return artifact;
123   }
124
125   public void setArtifact(ByteBuffer artifact) {
126     this.artifact = artifact;
127   }
128 }