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.action.dao.types;
23 import com.datastax.driver.mapping.annotations.Column;
24 import com.datastax.driver.mapping.annotations.PartitionKey;
25 import com.datastax.driver.mapping.annotations.Table;
26 import org.openecomp.sdc.action.types.ActionArtifact;
28 import java.nio.ByteBuffer;
30 @Table(keyspace = "dox", name = "action_artifact")
31 public class ActionArtifactEntity {
34 @Column(name = "artifactuuid")
35 private String artifactUuId;
37 @PartitionKey(value = 1)
38 @Column(name = "effective_version")
39 private int effectiveVersion;
41 @Column(name = "artifact")
42 private ByteBuffer artifact;
44 public ActionArtifactEntity() {
45 //Default constructor implementation
48 public ActionArtifactEntity(String artifactUuId, int effectiveVersion) {
49 this.artifactUuId = artifactUuId;
50 this.effectiveVersion = effectiveVersion;
53 public String getArtifactUuId() {
57 public void setArtifactUuId(String artifactUuId) {
58 this.artifactUuId = artifactUuId;
61 public int getEffectiveVersion() {
62 return effectiveVersion;
65 public void setEffectiveVersion(int effectiveVersion) {
66 this.effectiveVersion = effectiveVersion;
69 public ByteBuffer getArtifact() {
73 public void setArtifact(ByteBuffer artifact) {
74 this.artifact = artifact;
78 * To dto action artifact.
80 * @return the action artifact
82 public ActionArtifact toDto() {
83 ActionArtifact destination = new ActionArtifact();
84 destination.setArtifactUuId(this.getArtifactUuId());
85 destination.setEffectiveVersion(this.getEffectiveVersion());
86 destination.setArtifact(this.getArtifact().array());