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.ClusteringColumn;
24 import com.datastax.driver.mapping.annotations.Column;
25 import com.datastax.driver.mapping.annotations.PartitionKey;
26 import com.datastax.driver.mapping.annotations.Table;
27 import com.datastax.driver.mapping.annotations.Transient;
28 import java.nio.ByteBuffer;
29 import java.util.Date;
31 @Table(keyspace = "sdcartifact", name = "sdcschemafiles")
32 public class SdcSchemaFilesData {
34 @Column(name = "sdcreleasenum")
35 private String sdcReleaseNum;
38 @Column(name = "timestamp")
39 private Date timestamp;
42 @Column(name = "conformanceLevel")
43 private String conformanceLevel;
45 @Column(name = "fileName")
46 private String fileName;
48 @Column(name = "payload")
49 private ByteBuffer payload;
51 @Column(name = "checksum")
52 private String checksum;
54 public SdcSchemaFilesData() {
58 public SdcSchemaFilesData(String sdcReleaseNum, Date timestamp, String conformanceLevel, String fileName, byte[] payload, String checksum){
59 this.sdcReleaseNum = sdcReleaseNum;
60 this.timestamp = timestamp;
61 this.conformanceLevel = conformanceLevel;
62 this.fileName = fileName;
64 this.payload = ByteBuffer.wrap(payload.clone());
66 this.checksum = checksum;
69 public String getSdcReleaseNum() {
73 public void setSdcReleaseNum(String sdcReleaseNum) {
74 this.sdcReleaseNum = sdcReleaseNum;
77 public String getConformanceLevel() {
78 return conformanceLevel;
81 public void setConformanceLevel(String conformanceLevel) {
82 this.conformanceLevel = conformanceLevel;
85 public String getFileName() {
89 public void setFileName(String fileName) {
90 this.fileName = fileName;
93 public ByteBuffer getPayload() {
97 public void setPayload(ByteBuffer payload) {
99 this.payload = payload.duplicate();
103 public void setPayloadAsArray(byte[] payload) {
105 this.payload = ByteBuffer.wrap(payload.clone());
110 public byte[] getPayloadAsArray() {
111 return payload != null ? payload.array() : null;
114 public Date getTimestamp() {
118 public void setTimestamp(Date timestamp) {
119 this.timestamp = timestamp;
122 public String getChecksum() {
126 public void setChecksum(String checksum) {
127 this.checksum = checksum;
131 public String toString() {
132 return "SdcSchemaFilesData [sdcReleaseNum=" + sdcReleaseNum + ", timestamp=" + timestamp + ", conformanceLevel="
133 + conformanceLevel + ", fileName=" + fileName + ", checksum=" + checksum + "]";