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