2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
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.MonitoringUploadType;
29 import org.openecomp.sdc.versioning.dao.types.Version;
30 import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
32 import java.io.Serializable;
33 import java.nio.ByteBuffer;
35 @Table(keyspace = "dox", name = "vsp_component_artifact")
36 public class ComponentMonitoringUploadEntity implements VersionableEntity, Serializable {
37 public static final String ENTITY_TYPE = "Vendor Software Product Component Artifact";
39 @Column(name = "vsp_id")
41 @PartitionKey(value = 1)
43 private Version version;
45 @Column(name = "component_id")
46 private String componentId;
47 @ClusteringColumn(value = 1)
48 @Column(name = "artifact_type")
49 private MonitoringUploadType type;
50 @ClusteringColumn(value = 2)
51 @Column(name = "artifact_id")
53 @Column(name = "name")
54 private String artifactName;
55 private ByteBuffer artifact;
57 public ComponentMonitoringUploadEntity() {
62 * Instantiates a new Component artifact entity.
64 * @param vspId the vsp id
65 * @param version the version
66 * @param componentId the component id
69 public ComponentMonitoringUploadEntity(String vspId, Version version, String componentId,
72 this.version = version;
73 this.componentId = componentId;
77 public String getVspId() {
81 public void setVspId(String vspId) {
85 public String getComponentId() {
89 public void setComponentId(String componentId) {
90 this.componentId = componentId;
94 public String getEntityType() {
99 public String getFirstClassCitizenId() {
103 public String getId() {
107 public void setId(String id) {
111 public Version getVersion() {
115 public void setVersion(Version version) {
116 this.version = version;
119 public String getArtifactName() {
123 public void setArtifactName(String artifactName) {
124 this.artifactName = artifactName;
127 public ByteBuffer getArtifact() {
131 public void setArtifact(ByteBuffer artifact) {
132 this.artifact = artifact;
135 public MonitoringUploadType getType() {
139 public void setType(MonitoringUploadType type) {
144 public String toString() {
145 return "ComponentMonitoringUploadEntity{" +
146 "vspId='" + vspId + '\'' +
147 ", version=" + version +
148 ", componentId='" + componentId + '\'' +
150 ", id='" + id + '\'' +
151 ", artifactName='" + artifactName + '\'' +