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.Column;
27 import javax.persistence.Entity;
28 import javax.persistence.Id;
29 import javax.persistence.PrePersist;
30 import javax.persistence.Table;
31 import javax.persistence.Temporal;
32 import javax.persistence.TemporalType;
34 import org.apache.commons.lang3.builder.EqualsBuilder;
35 import org.apache.commons.lang3.builder.HashCodeBuilder;
37 import com.openpojo.business.annotation.BusinessKey;
40 @Table(name = "network_recipe")
41 public class NetworkRecipe implements Serializable, Recipe {
42 private static final long serialVersionUID = 768026109321305392L;
49 @Column(name = "ACTION")
50 protected String action;
52 @Column(name = "DESCRIPTION")
53 private String description;
56 @Column(name = "ORCHESTRATION_URI")
57 protected String orchestrationUri;
59 @Column(name = "RECIPE_TIMEOUT")
60 private Integer recipeTimeout;
62 @Column(name = "VERSION_STR")
63 private String versionStr;
66 @Column(name = "SERVICE_TYPE")
67 private String serviceType;
70 @Column(name = "MODEL_NAME")
71 private String modelName;
73 @Column(name = "NETWORK_PARAM_XSD")
74 private String paramXsd;
76 @Column(name = "CREATION_TIMESTAMP", updatable = false)
77 @Temporal(TemporalType.TIMESTAMP)
81 protected void onCreate() {
82 this.created = new Date();
86 public boolean equals(final Object other) {
87 if (!(other instanceof NetworkRecipe)) {
90 NetworkRecipe castOther = (NetworkRecipe) other;
91 return new EqualsBuilder().append(action, castOther.action).append(orchestrationUri, castOther.orchestrationUri)
92 .append(serviceType, castOther.serviceType).append(modelName, castOther.modelName).isEquals();
96 public int hashCode() {
97 return new HashCodeBuilder().append(action).append(orchestrationUri).append(serviceType).append(modelName)
101 public Integer getId() {
105 public void setId(Integer id) {
109 public String getAction() {
113 public void setAction(String action) {
114 this.action = action;
117 public String getDescription() {
121 public void setDescription(String description) {
122 this.description = description;
125 public String getOrchestrationUri() {
126 return orchestrationUri;
129 public void setOrchestrationUri(String orchestrationUri) {
130 this.orchestrationUri = orchestrationUri;
133 public Integer getRecipeTimeout() {
134 return recipeTimeout;
137 public void setRecipeTimeout(Integer recipeTimeout) {
138 this.recipeTimeout = recipeTimeout;
141 public String getServiceType() {
145 public void setServiceType(String serviceType) {
146 this.serviceType = serviceType;
149 public Date getCreated() {
153 public String getModelName() {
157 public void setModelName(String modelName) {
158 this.modelName = modelName;
161 public String getParamXsd() {
165 public void setParamXsd(String paramXsd) {
166 this.paramXsd = paramXsd;
170 public String toString() {
171 StringBuilder sb = new StringBuilder();
172 sb.append(super.toString());
173 sb.append(",modelName=" + modelName);
174 sb.append(",networkParamXSD=" + paramXsd);
175 return sb.toString();
178 public String getVersionStr() {
182 public void setVersionStr(String versionStr) {
183 this.versionStr = versionStr;