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 @Column(name = "RESOURCE_INPUT")
97 private String resourceInput;
99 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
100 @JoinColumn(name = "AR_MODEL_UUID")
101 private AllottedResource allottedResource;
104 public String toString() {
105 return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
106 .append("created", created).append("modelInstanceName", modelInstanceName)
107 .append("providingServiceModelInvariantUUID", providingServiceModelInvariantUUID)
108 .append("providingServiceModelUUID", providingServiceModelUUID)
109 .append("providingServiceModelName", providingServiceModelName)
110 .append("targetNetworkRole", targetNetworkRole).append("nfFunction", nfFunction)
111 .append("nfType", nfType).append("nfRole", nfRole).append("nfNamingCode", nfNamingCode)
112 .append("minInstances", minInstances).append("maxInstances", maxInstances)
113 .append("allottedResource", allottedResource).toString();
117 protected void onCreate() {
118 this.created = new Date();
122 public boolean equals(final Object other) {
123 if (!(other instanceof AllottedResourceCustomization)) {
126 AllottedResourceCustomization castOther = (AllottedResourceCustomization) other;
127 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
131 public int hashCode() {
132 return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();
135 public String getProvidingServiceModelUUID() {
136 return providingServiceModelUUID;
139 public void setProvidingServiceModelUUID(String providingServiceModelUUID) {
140 this.providingServiceModelUUID = providingServiceModelUUID;
143 public String getProvidingServiceModelName() {
144 return providingServiceModelName;
147 public void setProvidingServiceModelName(String providingServiceModelName) {
148 this.providingServiceModelName = providingServiceModelName;
151 public AllottedResourceCustomization() {
155 public String getModelCustomizationUUID() {
156 return this.modelCustomizationUUID;
159 public void setModelCustomizationUUID(String modelCustomizationUUID) {
160 this.modelCustomizationUUID = modelCustomizationUUID;
163 public Date getCreated() {
167 public String getModelInstanceName() {
168 return this.modelInstanceName;
171 public void setModelInstanceName(String modelInstanceName) {
172 this.modelInstanceName = modelInstanceName;
176 public AllottedResource getAllottedResource() {
177 return this.allottedResource;
180 public void setAllottedResource(AllottedResource allottedResource) {
181 this.allottedResource = allottedResource;
184 public String getProvidingServiceModelInvariantUUID() {
185 return this.providingServiceModelInvariantUUID;
188 public void setProvidingServiceModelInvariantUUID(String providingServiceModelInvariantUUID) {
189 this.providingServiceModelInvariantUUID = providingServiceModelInvariantUUID;
192 public String getTargetNetworkRole() {
193 return this.targetNetworkRole;
196 public void setTargetNetworkRole(String targetNetworkRole) {
197 this.targetNetworkRole = targetNetworkRole;
200 public String getNfFunction() {
201 return this.nfFunction;
204 public void setNfFunction(String nfFunction) {
205 this.nfFunction = nfFunction;
208 public String getNfType() {
212 public void setNfType(String nfType) {
213 this.nfType = nfType;
216 public String getNfRole() {
220 public void setNfRole(String nfRole) {
221 this.nfRole = nfRole;
224 public String getNfNamingCode() {
225 return this.nfNamingCode;
228 public void setNfNamingCode(String nfNamingCode) {
229 this.nfNamingCode = nfNamingCode;
232 public Integer getMinInstances() {
233 return this.minInstances;
236 public void setMinInstances(Integer minInstances) {
237 this.minInstances = minInstances;
240 public Integer getMaxInstances() {
241 return this.maxInstances;
244 public void setMaxInstances(Integer maxInstances) {
245 this.maxInstances = maxInstances;
248 public String getResourceInput() {
249 return resourceInput;
252 public void setResourceInput(String resourceInput) {
253 this.resourceInput = resourceInput;