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.be.resources.data;
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 com.datastax.driver.mapping.annotations.Transient;
28 import java.nio.ByteBuffer;
30 @Table(keyspace = "sdcartifact", name = "resources")
31 public class DAOArtifactData {
32 public static final String RRESOURCE_ID_FIELD = "resourceId";
34 public static final String SERVICE_NAME_FIELD = "serviceName";
35 public static final String SERVICE_VERSION_FIELD = "serviceVersion";
36 public static final String ARTIFACT_NAME_FIELD = "artifactName";
38 public static String delim = ":";
45 * Base64 encoded Artifact file data
49 private ByteBuffer data;
51 // private byte[] data;
53 public DAOArtifactData() {
57 public DAOArtifactData(String id) {
62 public DAOArtifactData(String artifactId, byte[] data) {
66 this.data = ByteBuffer.wrap(data.clone());
67 // this.data = data.clone();
73 public byte[] getDataAsArray() {
81 public void setDataAsArray(byte[] data) {
83 // this.data = data.clone();
84 this.data = ByteBuffer.wrap(data.clone());
88 public ByteBuffer getData() {
93 public void setData(ByteBuffer data) {
95 // this.data = data.clone();
96 this.data = data.duplicate();
100 public String getId() {
104 public void setId(String id) {