[SO] Release so 1.13.0 image
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / HeatFiles.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.onap.so.db.catalog.beans;
22
23 import java.io.Serializable;
24 import java.util.Date;
25 import javax.persistence.Column;
26 import javax.persistence.Entity;
27 import javax.persistence.Id;
28 import javax.persistence.Lob;
29 import javax.persistence.PrePersist;
30 import javax.persistence.Table;
31 import javax.persistence.Temporal;
32 import javax.persistence.TemporalType;
33 import org.apache.commons.lang3.builder.EqualsBuilder;
34 import org.apache.commons.lang3.builder.HashCodeBuilder;
35 import org.apache.commons.lang3.builder.ToStringBuilder;
36 import com.openpojo.business.annotation.BusinessKey;
37 import uk.co.blackpepper.bowman.annotation.RemoteResource;
38
39 @Entity
40 @RemoteResource("/heatFiles")
41 @Table(name = "heat_files")
42 public class HeatFiles implements Serializable {
43
44     private static final long serialVersionUID = 768026109321305392L;
45
46     @BusinessKey
47     @Id
48     @Column(name = "ARTIFACT_UUID")
49     private String artifactUuid;
50
51     @Column(name = "DESCRIPTION")
52     private String description = null;
53
54     @Column(name = "NAME")
55     private String fileName;
56
57     @Lob
58     @Column(name = "BODY", columnDefinition = "LONGTEXT")
59     private String fileBody;
60
61     @Column(name = "CREATION_TIMESTAMP", updatable = false)
62     @Temporal(TemporalType.TIMESTAMP)
63     private Date created;
64
65     @Column(name = "ARTIFACT_CHECKSUM")
66     private String artifactChecksum;
67
68     @Column(name = "VERSION")
69     private String version;
70
71     @PrePersist
72     protected void onCreate() {
73         this.created = new Date();
74     }
75
76     @Override
77     public String toString() {
78         return new ToStringBuilder(this).append("artifactUuid", artifactUuid).append("description", description)
79                 .append("fileName", fileName).append("fileBody", fileBody).append("created", created)
80                 .append("artifactChecksum", artifactChecksum).toString();
81     }
82
83     @Override
84     public boolean equals(final Object other) {
85         if (!(other instanceof HeatFiles)) {
86             return false;
87         }
88         HeatFiles castOther = (HeatFiles) other;
89         return new EqualsBuilder().append(artifactUuid, castOther.artifactUuid).isEquals();
90     }
91
92     @Override
93     public int hashCode() {
94         return new HashCodeBuilder().append(artifactUuid).toHashCode();
95     }
96
97     public String getArtifactUuid() {
98         return this.artifactUuid;
99     }
100
101     public void setArtifactUuid(String artifactUuid) {
102         this.artifactUuid = artifactUuid;
103     }
104
105     public String getDescription() {
106         return this.description;
107     }
108
109     public void setDescription(String description) {
110         this.description = description;
111     }
112
113     public String getFileName() {
114         return this.fileName;
115     }
116
117     public void setFileName(String fileName) {
118         this.fileName = fileName;
119     }
120
121     public String getFileBody() {
122         return this.fileBody;
123     }
124
125     public void setFileBody(String fileBody) {
126         this.fileBody = fileBody;
127     }
128
129     public Date getCreated() {
130         return created;
131     }
132
133     public String getAsdcUuid() {
134         return this.artifactUuid;
135     }
136
137     public void setAsdcUuid(String artifactUuid) {
138         this.artifactUuid = artifactUuid;
139     }
140
141     public String getArtifactChecksum() {
142         return artifactChecksum;
143     }
144
145     public void setArtifactChecksum(String artifactChecksum) {
146         this.artifactChecksum = artifactChecksum;
147     }
148
149     public String getVersion() {
150         return version;
151     }
152
153     public void setVersion(String version) {
154         this.version = version;
155     }
156 }