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;
42 import uk.co.blackpepper.bowman.annotation.RemoteResource;
45 @RemoteResource("/allottedResourceCustomization")
46 @Table(name = "allotted_resource_customization")
47 public class AllottedResourceCustomization implements Serializable {
49 private static final long serialVersionUID = 768026109321305392L;
53 @Column(name = "MODEL_CUSTOMIZATION_UUID")
54 private String modelCustomizationUUID;
56 @Column(name = "CREATION_TIMESTAMP", updatable = false)
57 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
58 @Temporal(TemporalType.TIMESTAMP)
61 @Column(name = "MODEL_INSTANCE_NAME")
62 private String modelInstanceName;
64 @Column(name = "PROVIDING_SERVICE_MODEL_INVARIANT_UUID")
65 private String providingServiceModelInvariantUUID;
67 @Column(name = "PROVIDING_SERVICE_MODEL_UUID")
68 private String providingServiceModelUUID;
70 @Column(name = "PROVIDING_SERVICE_MODEL_NAME")
71 private String providingServiceModelName;
73 @Column(name = "TARGET_NETWORK_ROLE")
74 private String targetNetworkRole;
76 @Column(name = "NF_FUNCTION")
77 private String nfFunction;
79 @Column(name = "NF_TYPE")
80 private String nfType;
82 @Column(name = "NF_ROLE")
83 private String nfRole;
85 @Column(name = "NF_NAMING_CODE")
86 private String nfNamingCode;
88 @Column(name = "MIN_INSTANCES")
89 private Integer minInstances;
91 @Column(name = "MAX_INSTANCES")
92 private Integer maxInstances;
94 @Column(name = "RESOURCE_INPUT")
95 private String resourceInput;
97 @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
98 @JoinColumn(name = "AR_MODEL_UUID")
99 private AllottedResource allottedResource;
102 public String toString() {
103 return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
104 .append("created", created).append("modelInstanceName", modelInstanceName)
105 .append("providingServiceModelInvariantUUID", providingServiceModelInvariantUUID)
106 .append("providingServiceModelUUID", providingServiceModelUUID)
107 .append("providingServiceModelName", providingServiceModelName)
108 .append("targetNetworkRole", targetNetworkRole).append("nfFunction", nfFunction)
109 .append("nfType", nfType).append("nfRole", nfRole).append("nfNamingCode", nfNamingCode)
110 .append("minInstances", minInstances).append("maxInstances", maxInstances)
111 .append("allottedResource", allottedResource).toString();
115 protected void onCreate() {
116 this.created = new Date();
120 public boolean equals(final Object other) {
121 if (!(other instanceof AllottedResourceCustomization)) {
124 AllottedResourceCustomization castOther = (AllottedResourceCustomization) other;
125 return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
129 public int hashCode() {
130 return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();
133 public String getProvidingServiceModelUUID() {
134 return providingServiceModelUUID;
137 public void setProvidingServiceModelUUID(String providingServiceModelUUID) {
138 this.providingServiceModelUUID = providingServiceModelUUID;
141 public String getProvidingServiceModelName() {
142 return providingServiceModelName;
145 public void setProvidingServiceModelName(String providingServiceModelName) {
146 this.providingServiceModelName = providingServiceModelName;
149 public AllottedResourceCustomization() {
153 public String getModelCustomizationUUID() {
154 return this.modelCustomizationUUID;
157 public void setModelCustomizationUUID(String modelCustomizationUUID) {
158 this.modelCustomizationUUID = modelCustomizationUUID;
161 public Date getCreated() {
165 public String getModelInstanceName() {
166 return this.modelInstanceName;
169 public void setModelInstanceName(String modelInstanceName) {
170 this.modelInstanceName = modelInstanceName;
174 public AllottedResource getAllottedResource() {
175 return this.allottedResource;
178 public void setAllottedResource(AllottedResource allottedResource) {
179 this.allottedResource = allottedResource;
182 public String getProvidingServiceModelInvariantUUID() {
183 return this.providingServiceModelInvariantUUID;
186 public void setProvidingServiceModelInvariantUUID(String providingServiceModelInvariantUUID) {
187 this.providingServiceModelInvariantUUID = providingServiceModelInvariantUUID;
190 public String getTargetNetworkRole() {
191 return this.targetNetworkRole;
194 public void setTargetNetworkRole(String targetNetworkRole) {
195 this.targetNetworkRole = targetNetworkRole;
198 public String getNfFunction() {
199 return this.nfFunction;
202 public void setNfFunction(String nfFunction) {
203 this.nfFunction = nfFunction;
206 public String getNfType() {
210 public void setNfType(String nfType) {
211 this.nfType = nfType;
214 public String getNfRole() {
218 public void setNfRole(String nfRole) {
219 this.nfRole = nfRole;
222 public String getNfNamingCode() {
223 return this.nfNamingCode;
226 public void setNfNamingCode(String nfNamingCode) {
227 this.nfNamingCode = nfNamingCode;
230 public Integer getMinInstances() {
231 return this.minInstances;
234 public void setMinInstances(Integer minInstances) {
235 this.minInstances = minInstances;
238 public Integer getMaxInstances() {
239 return this.maxInstances;
242 public void setMaxInstances(Integer maxInstances) {
243 this.maxInstances = maxInstances;
246 public String getResourceInput() {
247 return resourceInput;
250 public void setResourceInput(String resourceInput) {
251 this.resourceInput = resourceInput;