2 * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix
3 * Foundation. ================================================================================ Licensed under the
4 * Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may
5 * obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
8 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
9 * either express or implied. See the License for the specific language governing permissions and limitations under the
12 * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END=========================================================
15 package org.onap.so.db.catalog.beans;
17 import com.fasterxml.jackson.annotation.JsonFormat;
18 import com.openpojo.business.annotation.BusinessKey;
19 import java.io.Serializable;
20 import java.util.Date;
21 import javax.persistence.CascadeType;
22 import javax.persistence.Column;
23 import javax.persistence.Entity;
24 import javax.persistence.Id;
25 import javax.persistence.JoinColumn;
26 import javax.persistence.ManyToOne;
27 import javax.persistence.PrePersist;
28 import javax.persistence.Table;
29 import javax.persistence.Temporal;
30 import javax.persistence.TemporalType;
31 import org.apache.commons.lang3.builder.EqualsBuilder;
32 import org.apache.commons.lang3.builder.HashCodeBuilder;
33 import org.apache.commons.lang3.builder.ToStringBuilder;
34 import uk.co.blackpepper.bowman.annotation.LinkedResource;
37 @Table(name = "pnf_resource_customization")
38 public class PnfResourceCustomization implements Serializable {
40 private static final long serialVersionUID = 768026109321305415L;
44 @Column(name = "MODEL_CUSTOMIZATION_UUID")
45 private String modelCustomizationUUID;
47 @Column(name = "MODEL_INSTANCE_NAME")
48 private String modelInstanceName;
50 @Column(name = "CREATION_TIMESTAMP", updatable = false)
51 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
52 @Temporal(TemporalType.TIMESTAMP)
55 @Column(name = "NF_FUNCTION")
56 private String nfFunction;
58 @Column(name = "NF_TYPE")
59 private String nfType;
61 @Column(name = "NF_ROLE")
62 private String nfRole;
64 @Column(name = "NF_NAMING_CODE")
65 private String nfNamingCode;
67 @Column(name = "MULTI_STAGE_DESIGN")
68 private String multiStageDesign;
70 @Column(name = "RESOURCE_INPUT")
71 private String resourceInput;
73 @ManyToOne(cascade = CascadeType.ALL)
74 @JoinColumn(name = "PNF_RESOURCE_MODEL_UUID")
75 private PnfResource pnfResources;
77 @Column(name = "CDS_BLUEPRINT_NAME")
78 private String blueprintName;
80 @Column(name = "CDS_BLUEPRINT_VERSION")
81 private String blueprintVersion;
83 @Column(name = "SKIP_POST_INSTANTIATION_CONFIGURATION")
84 private Boolean skipPostInstConf;
86 @Column(name = "CONTROLLER_ACTOR")
87 private String controllerActor;
90 public String toString() {
91 return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
92 .append("modelInstanceName", modelInstanceName).append("created", created)
93 .append("nfFunction", nfFunction).append("nfType", nfType).append("nfRole", nfRole)
94 .append("nfNamingCode", nfNamingCode).append("multiStageDesign", multiStageDesign)
95 .append("pnfResources", pnfResources).append("blueprintName", blueprintName)
96 .append("blueprintVersion", blueprintVersion).append("controllerActor", controllerActor).toString();
100 public boolean equals(final Object other) {
101 if (!(other instanceof PnfResourceCustomization)) {
104 PnfResourceCustomization castOther = (PnfResourceCustomization) other;
105 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
109 public int hashCode() {
110 return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();
114 protected void onCreate() {
115 this.created = new Date();
118 public Date getCreationTimestamp() {
122 public void setCreated(Date created) {
123 this.created = created;
126 public String getModelCustomizationUUID() {
127 return modelCustomizationUUID;
130 public void setModelCustomizationUUID(String modelCustomizationUUID) {
131 this.modelCustomizationUUID = modelCustomizationUUID;
134 public String getModelInstanceName() {
135 return this.modelInstanceName;
138 public void setModelInstanceName(String modelInstanceName) {
139 this.modelInstanceName = modelInstanceName;
142 public String getNfFunction() {
146 public void setNfFunction(String nfFunction) {
147 this.nfFunction = nfFunction;
150 public String getNfType() {
154 public void setNfType(String nfType) {
155 this.nfType = nfType;
158 public String getNfRole() {
162 public void setNfRole(String nfRole) {
163 this.nfRole = nfRole;
166 public String getNfNamingCode() {
170 public void setNfNamingCode(String nfNamingCode) {
171 this.nfNamingCode = nfNamingCode;
174 public String getMultiStageDesign() {
175 return this.multiStageDesign;
178 public void setMultiStageDesign(String multiStageDesign) {
179 this.multiStageDesign = multiStageDesign;
183 public PnfResource getPnfResources() {
187 public void setPnfResources(PnfResource pnfResources) {
188 this.pnfResources = pnfResources;
191 public Date getCreated() {
195 public String getResourceInput() {
196 return resourceInput;
199 public void setResourceInput(String resourceInput) {
200 this.resourceInput = resourceInput;
204 public String getBlueprintName() {
205 return blueprintName;
208 public void setBlueprintName(String blueprintName) {
209 this.blueprintName = blueprintName;
212 public String getBlueprintVersion() {
213 return blueprintVersion;
216 public void setBlueprintVersion(String blueprintVersion) {
217 this.blueprintVersion = blueprintVersion;
220 public Boolean isSkipPostInstConf() {
221 return skipPostInstConf;
224 public void setSkipPostInstConf(Boolean skipPostInstConf) {
225 this.skipPostInstConf = skipPostInstConf;
228 public String getControllerActor() {
229 return controllerActor;
232 public void setControllerActor(String controllerActor) {
233 this.controllerActor = controllerActor;