2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2019 Nordix Foundation.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 * SPDX-License-Identifier: Apache-2.0
17 * ============LICENSE_END=========================================================
20 package org.onap.so.db.catalog.beans;
22 import com.fasterxml.jackson.annotation.JsonFormat;
23 import com.openpojo.business.annotation.BusinessKey;
24 import java.io.Serializable;
25 import java.util.Date;
26 import javax.persistence.CascadeType;
27 import javax.persistence.Column;
28 import javax.persistence.Entity;
29 import javax.persistence.Id;
30 import javax.persistence.JoinColumn;
31 import javax.persistence.ManyToOne;
32 import javax.persistence.PrePersist;
33 import javax.persistence.Table;
34 import javax.persistence.Temporal;
35 import javax.persistence.TemporalType;
36 import org.apache.commons.lang3.builder.EqualsBuilder;
37 import org.apache.commons.lang3.builder.HashCodeBuilder;
38 import org.apache.commons.lang3.builder.ToStringBuilder;
39 import uk.co.blackpepper.bowman.annotation.LinkedResource;
42 @Table(name = "pnf_resource_customization")
43 public class PnfResourceCustomization implements Serializable {
45 private static final long serialVersionUID = 768026109321305415L;
49 @Column(name = "MODEL_CUSTOMIZATION_UUID")
50 private String modelCustomizationUUID;
52 @Column(name = "MODEL_INSTANCE_NAME")
53 private String modelInstanceName;
55 @Column(name = "CREATION_TIMESTAMP", updatable = false)
56 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
57 @Temporal(TemporalType.TIMESTAMP)
60 @Column(name = "NF_FUNCTION")
61 private String nfFunction;
63 @Column(name = "NF_TYPE")
64 private String nfType;
66 @Column(name = "NF_ROLE")
67 private String nfRole;
69 @Column(name = "NF_NAMING_CODE")
70 private String nfNamingCode;
72 @Column(name = "MULTI_STAGE_DESIGN")
73 private String multiStageDesign;
75 @Column(name = "RESOURCE_INPUT")
76 private String resourceInput;
78 @ManyToOne(cascade = CascadeType.ALL)
79 @JoinColumn(name = "PNF_RESOURCE_MODEL_UUID")
80 private PnfResource pnfResources;
82 @Column(name = "CDS_BLUEPRINT_NAME")
83 private String blueprintName;
85 @Column(name = "CDS_BLUEPRINT_VERSION")
86 private String blueprintVersion;
88 @Column(name = "SKIP_POST_INSTANTIATION_CONFIGURATION")
89 private Boolean skipPostInstConf;
92 public String toString() {
93 return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
94 .append("modelInstanceName", modelInstanceName).append("created", created)
95 .append("nfFunction", nfFunction)
96 .append("nfType", nfType).append("nfRole", nfRole).append("nfNamingCode", nfNamingCode)
97 .append("multiStageDesign", multiStageDesign).append("pnfResources", pnfResources)
98 .append("blueprintName", blueprintName).append("blueprintVersion", blueprintVersion)
103 public boolean equals(final Object other) {
104 if (!(other instanceof PnfResourceCustomization)) {
107 PnfResourceCustomization castOther = (PnfResourceCustomization) other;
108 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
112 public int hashCode() {
113 return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();
117 protected void onCreate() {
118 this.created = new Date();
121 public Date getCreationTimestamp() {
125 public void setCreated(Date created) {
126 this.created = created;
129 public String getModelCustomizationUUID() {
130 return modelCustomizationUUID;
133 public void setModelCustomizationUUID(String modelCustomizationUUID) {
134 this.modelCustomizationUUID = modelCustomizationUUID;
137 public String getModelInstanceName() {
138 return this.modelInstanceName;
141 public void setModelInstanceName(String modelInstanceName) {
142 this.modelInstanceName = modelInstanceName;
145 public String getNfFunction() {
149 public void setNfFunction(String nfFunction) {
150 this.nfFunction = nfFunction;
153 public String getNfType() {
157 public void setNfType(String nfType) {
158 this.nfType = nfType;
161 public String getNfRole() {
165 public void setNfRole(String nfRole) {
166 this.nfRole = nfRole;
169 public String getNfNamingCode() {
173 public void setNfNamingCode(String nfNamingCode) {
174 this.nfNamingCode = nfNamingCode;
177 public String getMultiStageDesign() {
178 return this.multiStageDesign;
181 public void setMultiStageDesign(String multiStageDesign) {
182 this.multiStageDesign = multiStageDesign;
186 public PnfResource getPnfResources() {
190 public void setPnfResources(PnfResource pnfResources) {
191 this.pnfResources = pnfResources;
194 public Date getCreated() {
198 public String getResourceInput() {
199 return resourceInput;
202 public void setResourceInput(String resourceInput) {
203 this.resourceInput = resourceInput;
207 public String getBlueprintName() {
208 return blueprintName;
211 public void setBlueprintName(String blueprintName) {
212 this.blueprintName = blueprintName;
215 public String getBlueprintVersion() {
216 return blueprintVersion;
219 public void setBlueprintVersion(String blueprintVersion) {
220 this.blueprintVersion = blueprintVersion;
223 public Boolean isSkipPostInstConf() {
224 return skipPostInstConf;
227 public void setSkipPostInstConf(Boolean skipPostInstConf) {
228 this.skipPostInstConf = skipPostInstConf;