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.Column;
26 import javax.persistence.Entity;
27 import javax.persistence.Id;
28 import javax.persistence.PrePersist;
29 import javax.persistence.Table;
30 import javax.persistence.Temporal;
31 import javax.persistence.TemporalType;
32 import org.apache.commons.lang3.builder.EqualsBuilder;
33 import org.apache.commons.lang3.builder.HashCodeBuilder;
34 import org.apache.commons.lang3.builder.ToStringBuilder;
35 import com.openpojo.business.annotation.BusinessKey;
38 @Table(name = "vnf_recipe")
39 public class VnfRecipe implements Serializable, Recipe {
41 private static final long serialVersionUID = 768026109321305392L;
48 @Column(name = "NF_ROLE")
49 private String nfRole;
51 @Column(name = "VNF_PARAM_XSD")
52 private String paramXsd;
54 @Column(name = "VF_MODULE_ID")
55 private String vfModuleId;
58 @Column(name = "ACTION")
59 protected String action;
61 @Column(name = "description")
62 private String description;
65 @Column(name = "ORCHESTRATION_URI")
66 protected String orchestrationUri;
68 @Column(name = "RECIPE_TIMEOUT")
69 private Integer recipeTimeout;
71 @Column(name = "VERSION_STR")
72 private String versionStr;
75 @Column(name = "SERVICE_TYPE")
76 private String serviceType;
78 @Column(name = "CREATION_TIMESTAMP", updatable = false)
79 @Temporal(TemporalType.TIMESTAMP)
83 protected void onCreate() {
84 this.created = new Date();
88 public String toString() {
89 return new ToStringBuilder(this).append("id", id).append("vnfType", nfRole).append("paramXsd", paramXsd)
90 .append("vfModuleId", vfModuleId).append("action", action).append("description", description)
91 .append("orchestrationUri", orchestrationUri).append("recipeTimeout", recipeTimeout)
92 .append("serviceType", serviceType).append("created", created).toString();
96 public boolean equals(final Object other) {
97 if (!(other instanceof VnfRecipe)) {
100 VnfRecipe castOther = (VnfRecipe) other;
101 return new EqualsBuilder().append(nfRole, castOther.nfRole).append(action, castOther.action)
102 .append(orchestrationUri, castOther.orchestrationUri).append(serviceType, castOther.serviceType)
107 public int hashCode() {
108 return new HashCodeBuilder().append(nfRole).append(action).append(orchestrationUri).append(serviceType)
112 public String getNfRole() {
116 public void setNfRole(String nfRole) {
117 this.nfRole = nfRole;
120 public String getParamXsd() {
124 public void setParamXsd(String paramXsd) {
125 this.paramXsd = paramXsd;
128 public String getVfModuleId() {
132 public void setVfModuleId(String vfModuleId) {
133 this.vfModuleId = vfModuleId;
136 public Integer getId() {
140 public void setId(Integer id) {
144 public String getAction() {
148 public void setAction(String action) {
149 this.action = action;
152 public String getDescription() {
156 public void setDescription(String description) {
157 this.description = description;
160 public String getOrchestrationUri() {
161 return orchestrationUri;
164 public void setOrchestrationUri(String orchestrationUri) {
165 this.orchestrationUri = orchestrationUri;
168 public Integer getRecipeTimeout() {
169 return recipeTimeout;
172 public void setRecipeTimeout(Integer recipeTimeout) {
173 this.recipeTimeout = recipeTimeout;
176 public String getServiceType() {
180 public void setServiceType(String serviceType) {
181 this.serviceType = serviceType;
184 public Date getCreated() {
188 public String getVersionStr() {
192 public void setVersionStr(String versionStr) {
193 this.versionStr = versionStr;