Migrate "ms/controllerblueprints" from ccsdk/apps
[ccsdk/cds.git] / ms / controllerblueprints / modules / service / src / main / java / org / onap / ccsdk / cds / controllerblueprints / service / domain / BlueprintModel.java
1 /*
2  * Copyright © 2017-2018 AT&T Intellectual Property.
3  * Modifications Copyright © 2019 Bell Canada.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 package org.onap.ccsdk.cds.controllerblueprints.service.domain;
19
20 import com.fasterxml.jackson.annotation.JsonFormat;
21 import io.swagger.annotations.ApiModelProperty;
22 import org.hibernate.annotations.Proxy;
23 import org.springframework.data.annotation.LastModifiedDate;
24 import org.springframework.data.jpa.domain.support.AuditingEntityListener;
25
26 import javax.persistence.*;
27 import java.io.Serializable;
28 import java.util.Date;
29
30 /**
31  * BlueprintModel.java Purpose: Provide Configuration Generator BlueprintModel Entity
32  *
33  * @author Brinda Santh
34  * @version 1.0
35  */
36
37 @EntityListeners({AuditingEntityListener.class})
38 @Entity
39 @Table(name = "CONFIG_MODEL", uniqueConstraints=@UniqueConstraint(columnNames={"artifact_name","artifact_version"}))
40 @Proxy(lazy=false)
41 public class BlueprintModel implements Serializable {
42     private static final long serialVersionUID = 1L;
43     @Id
44     @Column(name = "config_model_id")
45     private String id;
46
47     @Column(name = "service_uuid")
48     private String serviceUUID;
49
50     @Column(name = "distribution_id")
51     private String distributionId;
52
53     @Column(name = "service_name")
54     private String serviceName;
55
56     @Column(name = "service_description")
57     private String serviceDescription;
58
59     @Column(name = "resource_uuid")
60     private String resourceUUID;
61
62     @Column(name = "resource_instance_name")
63     private String resourceInstanceName;
64
65     @Column(name = "resource_name")
66     private String resourceName;
67
68     @Column(name = "resource_version")
69     private String resourceVersion;
70
71     @Column(name = "resource_type")
72     private String resourceType;
73
74     @Column(name = "artifact_uuid")
75     private String artifactUUId;
76
77     @Column(name = "artifact_type")
78     private String artifactType;
79
80     @Column(name = "artifact_version", nullable = false)
81     @ApiModelProperty(required=true)
82     private String artifactVersion;
83
84     @Lob
85     @Column(name = "artifact_description")
86     private String artifactDescription;
87
88     @Column(name = "internal_version")
89     private Integer internalVersion;
90
91     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
92     @LastModifiedDate
93     @Temporal(TemporalType.TIMESTAMP)
94     @Column(name = "creation_date")
95     private Date createdDate = new Date();
96
97     @Column(name = "artifact_name", nullable = false)
98     @ApiModelProperty(required=true)
99     private String artifactName;
100
101     @Column(name = "published", nullable = false)
102     @ApiModelProperty(required=true)
103     private String published;
104
105     @Column(name = "updated_by", nullable = false)
106     @ApiModelProperty(required=true)
107     private String updatedBy;
108
109     @Lob
110     @Column(name = "tags", nullable = false)
111     @ApiModelProperty(required=true)
112     private String tags;
113
114     @OneToOne(mappedBy = "blueprintModel", fetch = FetchType.EAGER, orphanRemoval = true, cascade = CascadeType.ALL)
115     private org.onap.ccsdk.cds.controllerblueprints.service.domain.BlueprintModelContent blueprintModelContent;
116
117     public String getId() {
118         return id;
119     }
120
121     public void setId(String id) {
122         this.id = id;
123     }
124
125     public String getServiceUUID() {
126         return serviceUUID;
127     }
128
129     public void setServiceUUID(String serviceUUID) {
130         this.serviceUUID = serviceUUID;
131     }
132
133     public String getDistributionId() {
134         return distributionId;
135     }
136
137     public void setDistributionId(String distributionId) {
138         this.distributionId = distributionId;
139     }
140
141     public String getServiceName() {
142         return serviceName;
143     }
144
145     public void setServiceName(String serviceName) {
146         this.serviceName = serviceName;
147     }
148
149     public String getServiceDescription() {
150         return serviceDescription;
151     }
152
153     public void setServiceDescription(String serviceDescription) {
154         this.serviceDescription = serviceDescription;
155     }
156
157     public String getResourceUUID() {
158         return resourceUUID;
159     }
160
161     public void setResourceUUID(String resourceUUID) {
162         this.resourceUUID = resourceUUID;
163     }
164
165     public String getResourceInstanceName() {
166         return resourceInstanceName;
167     }
168
169     public void setResourceInstanceName(String resourceInstanceName) {
170         this.resourceInstanceName = resourceInstanceName;
171     }
172
173     public String getResourceName() {
174         return resourceName;
175     }
176
177     public void setResourceName(String resourceName) {
178         this.resourceName = resourceName;
179     }
180
181     public String getResourceVersion() {
182         return resourceVersion;
183     }
184
185     public void setResourceVersion(String resourceVersion) {
186         this.resourceVersion = resourceVersion;
187     }
188
189     public String getResourceType() {
190         return resourceType;
191     }
192
193     public void setResourceType(String resourceType) {
194         this.resourceType = resourceType;
195     }
196
197     public String getArtifactUUId() {
198         return artifactUUId;
199     }
200
201     public void setArtifactUUId(String artifactUUId) {
202         this.artifactUUId = artifactUUId;
203     }
204
205     public String getArtifactType() {
206         return artifactType;
207     }
208
209     public void setArtifactType(String artifactType) {
210         this.artifactType = artifactType;
211     }
212
213     public String getArtifactVersion() {
214         return artifactVersion;
215     }
216
217     public void setArtifactVersion(String artifactVersion) {
218         this.artifactVersion = artifactVersion;
219     }
220
221     public String getArtifactDescription() {
222         return artifactDescription;
223     }
224
225     public void setArtifactDescription(String artifactDescription) {
226         this.artifactDescription = artifactDescription;
227     }
228
229     public Integer getInternalVersion() {
230         return internalVersion;
231     }
232
233     public void setInternalVersion(Integer internalVersion) {
234         this.internalVersion = internalVersion;
235     }
236
237     public Date getCreatedDate() {
238         return createdDate;
239     }
240
241     public void setCreatedDate(Date createdDate) {
242         this.createdDate = createdDate;
243     }
244
245     public String getArtifactName() {
246         return artifactName;
247     }
248
249     public void setArtifactName(String artifactName) {
250         this.artifactName = artifactName;
251     }
252
253     public String getPublished() {
254         return published;
255     }
256
257     public void setPublished(String published) {
258         this.published = published;
259     }
260
261     public String getUpdatedBy() {
262         return updatedBy;
263     }
264
265     public void setUpdatedBy(String updatedBy) {
266         this.updatedBy = updatedBy;
267     }
268
269     public String getTags() {
270         return tags;
271     }
272
273     public void setTags(String tags) {
274         this.tags = tags;
275     }
276
277     public org.onap.ccsdk.cds.controllerblueprints.service.domain.BlueprintModelContent getBlueprintModelContent() {
278         return blueprintModelContent;
279     }
280
281     public void setBlueprintModelContent(
282         org.onap.ccsdk.cds.controllerblueprints.service.domain.BlueprintModelContent blueprintModelContent) {
283         this.blueprintModelContent = blueprintModelContent;
284     }
285 }