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 com.openpojo.business.annotation.BusinessKey;
37 @Table(name = "network_recipe")
38 public class NetworkRecipe implements Serializable, Recipe {
39 private static final long serialVersionUID = 768026109321305392L;
46 @Column(name = "ACTION")
47 protected String action;
49 @Column(name = "DESCRIPTION")
50 private String description;
53 @Column(name = "ORCHESTRATION_URI")
54 protected String orchestrationUri;
56 @Column(name = "RECIPE_TIMEOUT")
57 private Integer recipeTimeout;
59 @Column(name = "VERSION_STR")
60 private String versionStr;
63 @Column(name = "SERVICE_TYPE")
64 private String serviceType;
67 @Column(name = "MODEL_NAME")
68 private String modelName;
70 @Column(name = "NETWORK_PARAM_XSD")
71 private String paramXsd;
73 @Column(name = "CREATION_TIMESTAMP", updatable = false)
74 @Temporal(TemporalType.TIMESTAMP)
78 protected void onCreate() {
79 this.created = new Date();
83 public boolean equals(final Object other) {
84 if (!(other instanceof NetworkRecipe)) {
87 NetworkRecipe castOther = (NetworkRecipe) other;
88 return new EqualsBuilder().append(action, castOther.action).append(orchestrationUri, castOther.orchestrationUri)
89 .append(serviceType, castOther.serviceType).append(modelName, castOther.modelName).isEquals();
93 public int hashCode() {
94 return new HashCodeBuilder().append(action).append(orchestrationUri).append(serviceType).append(modelName)
98 public Integer getId() {
102 public void setId(Integer id) {
106 public String getAction() {
110 public void setAction(String action) {
111 this.action = action;
114 public String getDescription() {
118 public void setDescription(String description) {
119 this.description = description;
122 public String getOrchestrationUri() {
123 return orchestrationUri;
126 public void setOrchestrationUri(String orchestrationUri) {
127 this.orchestrationUri = orchestrationUri;
130 public Integer getRecipeTimeout() {
131 return recipeTimeout;
134 public void setRecipeTimeout(Integer recipeTimeout) {
135 this.recipeTimeout = recipeTimeout;
138 public String getServiceType() {
142 public void setServiceType(String serviceType) {
143 this.serviceType = serviceType;
146 public Date getCreated() {
150 public String getModelName() {
154 public void setModelName(String modelName) {
155 this.modelName = modelName;
158 public String getParamXsd() {
162 public void setParamXsd(String paramXsd) {
163 this.paramXsd = paramXsd;
167 public String toString() {
168 StringBuilder sb = new StringBuilder();
169 sb.append(super.toString());
170 sb.append(",modelName=" + modelName);
171 sb.append(",networkParamXSD=" + paramXsd);
172 return sb.toString();
175 public String getVersionStr() {
179 public void setVersionStr(String versionStr) {
180 this.versionStr = versionStr;