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;
26 import javax.persistence.CascadeType;
27 import javax.persistence.Column;
28 import javax.persistence.Entity;
29 import javax.persistence.FetchType;
30 import javax.persistence.Id;
31 import javax.persistence.JoinColumn;
32 import javax.persistence.ManyToOne;
33 import javax.persistence.PrePersist;
34 import javax.persistence.Table;
35 import javax.persistence.Temporal;
36 import javax.persistence.TemporalType;
38 import com.fasterxml.jackson.annotation.JsonFormat;
39 import org.apache.commons.lang3.builder.EqualsBuilder;
40 import org.apache.commons.lang3.builder.HashCodeBuilder;
41 import org.apache.commons.lang3.builder.ToStringBuilder;
43 import com.openpojo.business.annotation.BusinessKey;
45 import uk.co.blackpepper.bowman.annotation.LinkedResource;
48 @Table(name = "allotted_resource_customization")
49 public class AllottedResourceCustomization implements Serializable {
51 private static final long serialVersionUID = 768026109321305392L;
55 @Column(name = "MODEL_CUSTOMIZATION_UUID")
56 private String modelCustomizationUUID;
58 @Column(name = "CREATION_TIMESTAMP", updatable = false)
59 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
60 @Temporal(TemporalType.TIMESTAMP)
63 @Column(name = "MODEL_INSTANCE_NAME")
64 private String modelInstanceName;
66 @Column(name = "PROVIDING_SERVICE_MODEL_INVARIANT_UUID")
67 private String providingServiceModelInvariantUUID;
69 @Column(name = "PROVIDING_SERVICE_MODEL_UUID")
70 private String providingServiceModelUUID;
72 @Column(name = "PROVIDING_SERVICE_MODEL_NAME")
73 private String providingServiceModelName;
75 @Column(name = "TARGET_NETWORK_ROLE")
76 private String targetNetworkRole;
78 @Column(name = "NF_FUNCTION")
79 private String nfFunction;
81 @Column(name = "NF_TYPE")
82 private String nfType;
84 @Column(name = "NF_ROLE")
85 private String nfRole;
87 @Column(name = "NF_NAMING_CODE")
88 private String nfNamingCode;
90 @Column(name = "MIN_INSTANCES")
91 private Integer minInstances;
93 @Column(name = "MAX_INSTANCES")
94 private Integer maxInstances;
96 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
97 @JoinColumn(name = "AR_MODEL_UUID")
98 private AllottedResource allottedResource;
101 public String toString() {
102 return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
103 .append("created", created).append("modelInstanceName", modelInstanceName)
104 .append("providingServiceModelInvariantUUID", providingServiceModelInvariantUUID)
105 .append("providingServiceModelUUID", providingServiceModelUUID)
106 .append("providingServiceModelName", providingServiceModelName)
107 .append("targetNetworkRole", targetNetworkRole).append("nfFunction", nfFunction)
108 .append("nfType", nfType).append("nfRole", nfRole).append("nfNamingCode", nfNamingCode)
109 .append("minInstances", minInstances).append("maxInstances", maxInstances)
110 .append("allottedResource", allottedResource).toString();
114 protected void onCreate() {
115 this.created = new Date();
119 public boolean equals(final Object other) {
120 if (!(other instanceof AllottedResourceCustomization)) {
123 AllottedResourceCustomization castOther = (AllottedResourceCustomization) other;
124 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
128 public int hashCode() {
129 return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();
132 public String getProvidingServiceModelUUID() {
133 return providingServiceModelUUID;
136 public void setProvidingServiceModelUUID(String providingServiceModelUUID) {
137 this.providingServiceModelUUID = providingServiceModelUUID;
140 public String getProvidingServiceModelName() {
141 return providingServiceModelName;
144 public void setProvidingServiceModelName(String providingServiceModelName) {
145 this.providingServiceModelName = providingServiceModelName;
148 public AllottedResourceCustomization() {
152 public String getModelCustomizationUUID() {
153 return this.modelCustomizationUUID;
156 public void setModelCustomizationUUID(String modelCustomizationUUID) {
157 this.modelCustomizationUUID = modelCustomizationUUID;
160 public Date getCreated() {
164 public String getModelInstanceName() {
165 return this.modelInstanceName;
168 public void setModelInstanceName(String modelInstanceName) {
169 this.modelInstanceName = modelInstanceName;
173 public AllottedResource getAllottedResource() {
174 return this.allottedResource;
177 public void setAllottedResource(AllottedResource allottedResource) {
178 this.allottedResource = allottedResource;
181 public String getProvidingServiceModelInvariantUUID() {
182 return this.providingServiceModelInvariantUUID;
185 public void setProvidingServiceModelInvariantUUID(String providingServiceModelInvariantUUID) {
186 this.providingServiceModelInvariantUUID = providingServiceModelInvariantUUID;
189 public String getTargetNetworkRole() {
190 return this.targetNetworkRole;
193 public void setTargetNetworkRole(String targetNetworkRole) {
194 this.targetNetworkRole = targetNetworkRole;
197 public String getNfFunction() {
198 return this.nfFunction;
201 public void setNfFunction(String nfFunction) {
202 this.nfFunction = nfFunction;
205 public String getNfType() {
209 public void setNfType(String nfType) {
210 this.nfType = nfType;
213 public String getNfRole() {
217 public void setNfRole(String nfRole) {
218 this.nfRole = nfRole;
221 public String getNfNamingCode() {
222 return this.nfNamingCode;
225 public void setNfNamingCode(String nfNamingCode) {
226 this.nfNamingCode = nfNamingCode;
229 public Integer getMinInstances() {
230 return this.minInstances;
233 public void setMinInstances(Integer minInstances) {
234 this.minInstances = minInstances;
237 public Integer getMaxInstances() {
238 return this.maxInstances;
241 public void setMaxInstances(Integer maxInstances) {
242 this.maxInstances = maxInstances;