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;
35 import uk.co.blackpepper.bowman.annotation.RemoteResource;
38 @RemoteResource("/networkRecipe")
39 @Table(name = "network_recipe")
40 public class NetworkRecipe implements Serializable, Recipe {
41 private static final long serialVersionUID = 768026109321305392L;
48 @Column(name = "ACTION")
49 protected String action;
51 @Column(name = "DESCRIPTION")
52 private String description;
55 @Column(name = "ORCHESTRATION_URI")
56 protected String orchestrationUri;
58 @Column(name = "RECIPE_TIMEOUT")
59 private Integer recipeTimeout;
61 @Column(name = "VERSION_STR")
62 private String versionStr;
65 @Column(name = "SERVICE_TYPE")
66 private String serviceType;
69 @Column(name = "MODEL_NAME")
70 private String modelName;
72 @Column(name = "NETWORK_PARAM_XSD")
73 private String paramXsd;
75 @Column(name = "CREATION_TIMESTAMP", updatable = false)
76 @Temporal(TemporalType.TIMESTAMP)
80 protected void onCreate() {
81 this.created = new Date();
85 public boolean equals(final Object other) {
86 if (!(other instanceof NetworkRecipe)) {
89 NetworkRecipe castOther = (NetworkRecipe) other;
90 return new EqualsBuilder().append(action, castOther.action).append(orchestrationUri, castOther.orchestrationUri)
91 .append(serviceType, castOther.serviceType).append(modelName, castOther.modelName).isEquals();
95 public int hashCode() {
96 return new HashCodeBuilder().append(action).append(orchestrationUri).append(serviceType).append(modelName)
100 public Integer getId() {
104 public void setId(Integer id) {
108 public String getAction() {
112 public void setAction(String action) {
113 this.action = action;
116 public String getDescription() {
120 public void setDescription(String description) {
121 this.description = description;
124 public String getOrchestrationUri() {
125 return orchestrationUri;
128 public void setOrchestrationUri(String orchestrationUri) {
129 this.orchestrationUri = orchestrationUri;
132 public Integer getRecipeTimeout() {
133 return recipeTimeout;
136 public void setRecipeTimeout(Integer recipeTimeout) {
137 this.recipeTimeout = recipeTimeout;
140 public String getServiceType() {
144 public void setServiceType(String serviceType) {
145 this.serviceType = serviceType;
148 public Date getCreated() {
152 public String getModelName() {
156 public void setModelName(String modelName) {
157 this.modelName = modelName;
160 public String getParamXsd() {
164 public void setParamXsd(String paramXsd) {
165 this.paramXsd = paramXsd;
169 public String toString() {
170 StringBuilder sb = new StringBuilder();
171 sb.append(super.toString());
172 sb.append(",modelName=" + modelName);
173 sb.append(",networkParamXSD=" + paramXsd);
174 return sb.toString();
177 public String getVersionStr() {
181 public void setVersionStr(String versionStr) {
182 this.versionStr = versionStr;