2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.so.db.catalog.beans;
23 import java.io.Serializable;
24 import java.util.Date;
25 import javax.persistence.CascadeType;
26 import javax.persistence.Column;
27 import javax.persistence.Entity;
28 import javax.persistence.FetchType;
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 com.fasterxml.jackson.annotation.JsonFormat;
37 import org.apache.commons.lang3.builder.EqualsBuilder;
38 import org.apache.commons.lang3.builder.HashCodeBuilder;
39 import org.apache.commons.lang3.builder.ToStringBuilder;
40 import com.openpojo.business.annotation.BusinessKey;
41 import uk.co.blackpepper.bowman.annotation.LinkedResource;
44 @Table(name = "allotted_resource_customization")
45 public class AllottedResourceCustomization implements Serializable {
47 private static final long serialVersionUID = 768026109321305392L;
51 @Column(name = "MODEL_CUSTOMIZATION_UUID")
52 private String modelCustomizationUUID;
54 @Column(name = "CREATION_TIMESTAMP", updatable = false)
55 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
56 @Temporal(TemporalType.TIMESTAMP)
59 @Column(name = "MODEL_INSTANCE_NAME")
60 private String modelInstanceName;
62 @Column(name = "PROVIDING_SERVICE_MODEL_INVARIANT_UUID")
63 private String providingServiceModelInvariantUUID;
65 @Column(name = "PROVIDING_SERVICE_MODEL_UUID")
66 private String providingServiceModelUUID;
68 @Column(name = "PROVIDING_SERVICE_MODEL_NAME")
69 private String providingServiceModelName;
71 @Column(name = "TARGET_NETWORK_ROLE")
72 private String targetNetworkRole;
74 @Column(name = "NF_FUNCTION")
75 private String nfFunction;
77 @Column(name = "NF_TYPE")
78 private String nfType;
80 @Column(name = "NF_ROLE")
81 private String nfRole;
83 @Column(name = "NF_NAMING_CODE")
84 private String nfNamingCode;
86 @Column(name = "MIN_INSTANCES")
87 private Integer minInstances;
89 @Column(name = "MAX_INSTANCES")
90 private Integer maxInstances;
92 @Column(name = "RESOURCE_INPUT")
93 private String resourceInput;
95 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
96 @JoinColumn(name = "AR_MODEL_UUID")
97 private AllottedResource allottedResource;
100 public String toString() {
101 return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
102 .append("created", created).append("modelInstanceName", modelInstanceName)
103 .append("providingServiceModelInvariantUUID", providingServiceModelInvariantUUID)
104 .append("providingServiceModelUUID", providingServiceModelUUID)
105 .append("providingServiceModelName", providingServiceModelName)
106 .append("targetNetworkRole", targetNetworkRole).append("nfFunction", nfFunction)
107 .append("nfType", nfType).append("nfRole", nfRole).append("nfNamingCode", nfNamingCode)
108 .append("minInstances", minInstances).append("maxInstances", maxInstances)
109 .append("allottedResource", allottedResource).toString();
113 protected void onCreate() {
114 this.created = new Date();
118 public boolean equals(final Object other) {
119 if (!(other instanceof AllottedResourceCustomization)) {
122 AllottedResourceCustomization castOther = (AllottedResourceCustomization) other;
123 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
127 public int hashCode() {
128 return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();
131 public String getProvidingServiceModelUUID() {
132 return providingServiceModelUUID;
135 public void setProvidingServiceModelUUID(String providingServiceModelUUID) {
136 this.providingServiceModelUUID = providingServiceModelUUID;
139 public String getProvidingServiceModelName() {
140 return providingServiceModelName;
143 public void setProvidingServiceModelName(String providingServiceModelName) {
144 this.providingServiceModelName = providingServiceModelName;
147 public AllottedResourceCustomization() {
151 public String getModelCustomizationUUID() {
152 return this.modelCustomizationUUID;
155 public void setModelCustomizationUUID(String modelCustomizationUUID) {
156 this.modelCustomizationUUID = modelCustomizationUUID;
159 public Date getCreated() {
163 public String getModelInstanceName() {
164 return this.modelInstanceName;
167 public void setModelInstanceName(String modelInstanceName) {
168 this.modelInstanceName = modelInstanceName;
172 public AllottedResource getAllottedResource() {
173 return this.allottedResource;
176 public void setAllottedResource(AllottedResource allottedResource) {
177 this.allottedResource = allottedResource;
180 public String getProvidingServiceModelInvariantUUID() {
181 return this.providingServiceModelInvariantUUID;
184 public void setProvidingServiceModelInvariantUUID(String providingServiceModelInvariantUUID) {
185 this.providingServiceModelInvariantUUID = providingServiceModelInvariantUUID;
188 public String getTargetNetworkRole() {
189 return this.targetNetworkRole;
192 public void setTargetNetworkRole(String targetNetworkRole) {
193 this.targetNetworkRole = targetNetworkRole;
196 public String getNfFunction() {
197 return this.nfFunction;
200 public void setNfFunction(String nfFunction) {
201 this.nfFunction = nfFunction;
204 public String getNfType() {
208 public void setNfType(String nfType) {
209 this.nfType = nfType;
212 public String getNfRole() {
216 public void setNfRole(String nfRole) {
217 this.nfRole = nfRole;
220 public String getNfNamingCode() {
221 return this.nfNamingCode;
224 public void setNfNamingCode(String nfNamingCode) {
225 this.nfNamingCode = nfNamingCode;
228 public Integer getMinInstances() {
229 return this.minInstances;
232 public void setMinInstances(Integer minInstances) {
233 this.minInstances = minInstances;
236 public Integer getMaxInstances() {
237 return this.maxInstances;
240 public void setMaxInstances(Integer maxInstances) {
241 this.maxInstances = maxInstances;
244 public String getResourceInput() {
245 return resourceInput;
248 public void setResourceInput(String resourceInput) {
249 this.resourceInput = resourceInput;