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