skip post instantiation configuration
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / PnfResourceCustomization.java
1 /*
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
8  *
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.
15  *
16  *  SPDX-License-Identifier: Apache-2.0
17  *  ============LICENSE_END=========================================================
18  */
19
20 package org.onap.so.db.catalog.beans;
21
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;
40
41 @Entity
42 @Table(name = "pnf_resource_customization")
43 public class PnfResourceCustomization implements Serializable {
44
45     private static final long serialVersionUID = 768026109321305415L;
46
47     @BusinessKey
48     @Id
49     @Column(name = "MODEL_CUSTOMIZATION_UUID")
50     private String modelCustomizationUUID;
51
52     @Column(name = "MODEL_INSTANCE_NAME")
53     private String modelInstanceName;
54
55     @Column(name = "CREATION_TIMESTAMP", updatable = false)
56     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
57     @Temporal(TemporalType.TIMESTAMP)
58     private Date created;
59
60     @Column(name = "NF_FUNCTION")
61     private String nfFunction;
62
63     @Column(name = "NF_TYPE")
64     private String nfType;
65
66     @Column(name = "NF_ROLE")
67     private String nfRole;
68
69     @Column(name = "NF_NAMING_CODE")
70     private String nfNamingCode;
71
72     @Column(name = "MULTI_STAGE_DESIGN")
73     private String multiStageDesign;
74
75     @Column(name = "RESOURCE_INPUT")
76     private String resourceInput;
77
78     @ManyToOne(cascade = CascadeType.ALL)
79     @JoinColumn(name = "PNF_RESOURCE_MODEL_UUID")
80     private PnfResource pnfResources;
81
82     @Column(name = "CDS_BLUEPRINT_NAME")
83     private String blueprintName;
84
85     @Column(name = "CDS_BLUEPRINT_VERSION")
86     private String blueprintVersion;
87
88     @Column(name = "SKIP_POST_INSTANTIATION_CONFIGURATION")
89     private Boolean skipPostInstConf;
90
91     @Override
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)
99             .toString();
100     }
101
102     @Override
103     public boolean equals(final Object other) {
104         if (!(other instanceof PnfResourceCustomization)) {
105             return false;
106         }
107         PnfResourceCustomization castOther = (PnfResourceCustomization) other;
108         return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
109     }
110
111     @Override
112     public int hashCode() {
113         return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();
114     }
115
116     @PrePersist
117     protected void onCreate() {
118         this.created = new Date();
119     }
120
121     public Date getCreationTimestamp() {
122         return this.created;
123     }
124
125     public void setCreated(Date created) {
126         this.created = created;
127     }
128
129     public String getModelCustomizationUUID() {
130         return modelCustomizationUUID;
131     }
132
133     public void setModelCustomizationUUID(String modelCustomizationUUID) {
134         this.modelCustomizationUUID = modelCustomizationUUID;
135     }
136
137     public String getModelInstanceName() {
138         return this.modelInstanceName;
139     }
140
141     public void setModelInstanceName(String modelInstanceName) {
142         this.modelInstanceName = modelInstanceName;
143     }
144
145     public String getNfFunction() {
146         return nfFunction;
147     }
148
149     public void setNfFunction(String nfFunction) {
150         this.nfFunction = nfFunction;
151     }
152
153     public String getNfType() {
154         return nfType;
155     }
156
157     public void setNfType(String nfType) {
158         this.nfType = nfType;
159     }
160
161     public String getNfRole() {
162         return nfRole;
163     }
164
165     public void setNfRole(String nfRole) {
166         this.nfRole = nfRole;
167     }
168
169     public String getNfNamingCode() {
170         return nfNamingCode;
171     }
172
173     public void setNfNamingCode(String nfNamingCode) {
174         this.nfNamingCode = nfNamingCode;
175     }
176
177     public String getMultiStageDesign() {
178         return this.multiStageDesign;
179     }
180
181     public void setMultiStageDesign(String multiStageDesign) {
182         this.multiStageDesign = multiStageDesign;
183     }
184
185     @LinkedResource
186     public PnfResource getPnfResources() {
187         return pnfResources;
188     }
189
190     public void setPnfResources(PnfResource pnfResources) {
191         this.pnfResources = pnfResources;
192     }
193
194     public Date getCreated() {
195         return created;
196     }
197
198     public String getResourceInput() {
199         return resourceInput;
200     }
201
202     public void setResourceInput(String resourceInput) {
203         this.resourceInput = resourceInput;
204     }
205
206
207     public String getBlueprintName() {
208         return blueprintName;
209     }
210
211     public void setBlueprintName(String blueprintName) {
212         this.blueprintName = blueprintName;
213     }
214
215     public String getBlueprintVersion() {
216         return blueprintVersion;
217     }
218
219     public void setBlueprintVersion(String blueprintVersion) {
220         this.blueprintVersion = blueprintVersion;
221     }
222
223     public Boolean isSkipPostInstConf() {
224         return skipPostInstConf;
225     }
226
227     public void setSkipPostInstConf(Boolean skipPostInstConf) {
228         this.skipPostInstConf = skipPostInstConf;
229     }
230
231 }