2 * Copyright © 2017-2018 AT&T Intellectual Property.
\r
3 * Modifications Copyright © 2019 Bell Canada.
\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
9 * http://www.apache.org/licenses/LICENSE-2.0
\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
18 package org.onap.ccsdk.apps.controllerblueprints.service.domain;
\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
26 import javax.persistence.*;
\r
27 import java.io.Serializable;
\r
28 import java.util.Date;
\r
31 * BlueprintModel.java Purpose: Provide Configuration Generator BlueprintModel Entity
\r
33 * @author Brinda Santh
\r
37 @EntityListeners({AuditingEntityListener.class})
\r
39 @Table(name = "CONFIG_MODEL", uniqueConstraints=@UniqueConstraint(columnNames={"artifact_name","artifact_version"}))
\r
41 public class BlueprintModel implements Serializable {
\r
42 private static final long serialVersionUID = 1L;
\r
44 @Column(name = "config_model_id")
\r
47 @Column(name = "service_uuid")
\r
48 private String serviceUUID;
\r
50 @Column(name = "distribution_id")
\r
51 private String distributionId;
\r
53 @Column(name = "service_name")
\r
54 private String serviceName;
\r
56 @Column(name = "service_description")
\r
57 private String serviceDescription;
\r
59 @Column(name = "resource_uuid")
\r
60 private String resourceUUID;
\r
62 @Column(name = "resource_instance_name")
\r
63 private String resourceInstanceName;
\r
65 @Column(name = "resource_name")
\r
66 private String resourceName;
\r
68 @Column(name = "resource_version")
\r
69 private String resourceVersion;
\r
71 @Column(name = "resource_type")
\r
72 private String resourceType;
\r
74 @Column(name = "artifact_uuid")
\r
75 private String artifactUUId;
\r
77 @Column(name = "artifact_type")
\r
78 private String artifactType;
\r
80 @Column(name = "artifact_version", nullable = false)
\r
81 @ApiModelProperty(required=true)
\r
82 private String artifactVersion;
\r
85 @Column(name = "artifact_description")
\r
86 private String artifactDescription;
\r
88 @Column(name = "internal_version")
\r
89 private Integer internalVersion;
\r
91 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
\r
93 @Temporal(TemporalType.TIMESTAMP)
\r
94 @Column(name = "creation_date")
\r
95 private Date createdDate = new Date();
\r
97 @Column(name = "artifact_name", nullable = false)
\r
98 @ApiModelProperty(required=true)
\r
99 private String artifactName;
\r
101 @Column(name = "published", nullable = false)
\r
102 @ApiModelProperty(required=true)
\r
103 private String published;
\r
105 @Column(name = "updated_by", nullable = false)
\r
106 @ApiModelProperty(required=true)
\r
107 private String updatedBy;
\r
110 @Column(name = "tags", nullable = false)
\r
111 @ApiModelProperty(required=true)
\r
112 private String tags;
\r
114 @OneToOne(mappedBy = "blueprintModel", fetch = FetchType.EAGER, orphanRemoval = true, cascade = CascadeType.ALL)
\r
115 private BlueprintModelContent blueprintModelContent;
\r
117 public String getId() {
\r
121 public void setId(String id) {
\r
125 public String getServiceUUID() {
\r
126 return serviceUUID;
\r
129 public void setServiceUUID(String serviceUUID) {
\r
130 this.serviceUUID = serviceUUID;
\r
133 public String getDistributionId() {
\r
134 return distributionId;
\r
137 public void setDistributionId(String distributionId) {
\r
138 this.distributionId = distributionId;
\r
141 public String getServiceName() {
\r
142 return serviceName;
\r
145 public void setServiceName(String serviceName) {
\r
146 this.serviceName = serviceName;
\r
149 public String getServiceDescription() {
\r
150 return serviceDescription;
\r
153 public void setServiceDescription(String serviceDescription) {
\r
154 this.serviceDescription = serviceDescription;
\r
157 public String getResourceUUID() {
\r
158 return resourceUUID;
\r
161 public void setResourceUUID(String resourceUUID) {
\r
162 this.resourceUUID = resourceUUID;
\r
165 public String getResourceInstanceName() {
\r
166 return resourceInstanceName;
\r
169 public void setResourceInstanceName(String resourceInstanceName) {
\r
170 this.resourceInstanceName = resourceInstanceName;
\r
173 public String getResourceName() {
\r
174 return resourceName;
\r
177 public void setResourceName(String resourceName) {
\r
178 this.resourceName = resourceName;
\r
181 public String getResourceVersion() {
\r
182 return resourceVersion;
\r
185 public void setResourceVersion(String resourceVersion) {
\r
186 this.resourceVersion = resourceVersion;
\r
189 public String getResourceType() {
\r
190 return resourceType;
\r
193 public void setResourceType(String resourceType) {
\r
194 this.resourceType = resourceType;
\r
197 public String getArtifactUUId() {
\r
198 return artifactUUId;
\r
201 public void setArtifactUUId(String artifactUUId) {
\r
202 this.artifactUUId = artifactUUId;
\r
205 public String getArtifactType() {
\r
206 return artifactType;
\r
209 public void setArtifactType(String artifactType) {
\r
210 this.artifactType = artifactType;
\r
213 public String getArtifactVersion() {
\r
214 return artifactVersion;
\r
217 public void setArtifactVersion(String artifactVersion) {
\r
218 this.artifactVersion = artifactVersion;
\r
221 public String getArtifactDescription() {
\r
222 return artifactDescription;
\r
225 public void setArtifactDescription(String artifactDescription) {
\r
226 this.artifactDescription = artifactDescription;
\r
229 public Integer getInternalVersion() {
\r
230 return internalVersion;
\r
233 public void setInternalVersion(Integer internalVersion) {
\r
234 this.internalVersion = internalVersion;
\r
237 public Date getCreatedDate() {
\r
238 return createdDate;
\r
241 public void setCreatedDate(Date createdDate) {
\r
242 this.createdDate = createdDate;
\r
245 public String getArtifactName() {
\r
246 return artifactName;
\r
249 public void setArtifactName(String artifactName) {
\r
250 this.artifactName = artifactName;
\r
253 public String getPublished() {
\r
257 public void setPublished(String published) {
\r
258 this.published = published;
\r
261 public String getUpdatedBy() {
\r
265 public void setUpdatedBy(String updatedBy) {
\r
266 this.updatedBy = updatedBy;
\r
269 public String getTags() {
\r
273 public void setTags(String tags) {
\r
277 public BlueprintModelContent getBlueprintModelContent() {
\r
278 return blueprintModelContent;
\r
281 public void setBlueprintModelContent(BlueprintModelContent blueprintModelContent) {
\r
282 this.blueprintModelContent = blueprintModelContent;
\r