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;
27 import java.nio.ByteBuffer;
29 @Table(keyspace = "sdcartifact", name = "resources")
30 public class ESArtifactData {
31 public static final String RRESOURCE_ID_FIELD = "resourceId";
33 public static final String SERVICE_NAME_FIELD = "serviceName";
34 public static final String SERVICE_VERSION_FIELD = "serviceVersion";
35 public static final String ARTIFACT_NAME_FIELD = "artifactName";
37 public final static String delim = ":";
44 * Base64 encoded Artifact file data
48 private ByteBuffer data;
50 // private byte[] data;
52 public ESArtifactData() {
56 public ESArtifactData(String id) {
61 public ESArtifactData(String artifactId, byte[] data) {
65 this.data = ByteBuffer.wrap(data.clone());
66 // this.data = data.clone();
71 public byte[] getDataAsArray() {
79 public void setDataAsArray(byte[] data) {
81 // this.data = data.clone();
82 this.data = ByteBuffer.wrap(data.clone());
86 public ByteBuffer getData() {
91 public void setData(ByteBuffer data) {
93 // this.data = data.clone();
94 this.data = data.duplicate();
98 public String getId() {
102 public void setId(String id) {