Merge "Fix issue where user cannot create a recipe via"
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / VnfComponentsRecipe.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.onap.so.db.catalog.beans;
22
23 import java.io.Serializable;
24 import javax.persistence.Column;
25 import javax.persistence.Entity;
26 import javax.persistence.GeneratedValue;
27 import javax.persistence.GenerationType;
28 import javax.persistence.Id;
29 import javax.persistence.Table;
30 import org.apache.commons.lang3.builder.EqualsBuilder;
31 import org.apache.commons.lang3.builder.HashCodeBuilder;
32 import org.apache.commons.lang3.builder.ToStringBuilder;
33 import com.openpojo.business.annotation.BusinessKey;
34
35 @Entity
36 @Table(name = "vnf_components_recipe")
37 public class VnfComponentsRecipe implements Serializable, Recipe {
38
39     private static final long serialVersionUID = 768026109321305392L;
40
41     @Id
42     @Column(name = "id")
43     @GeneratedValue(strategy = GenerationType.IDENTITY)
44     private Integer id;
45
46     @BusinessKey
47     @Column(name = "ACTION")
48     private String action;
49
50     @Column(name = "DESCRIPTION")
51     private String description;
52
53     @BusinessKey
54     @Column(name = "ORCHESTRATION_URI")
55     private String orchestrationUri;
56
57     @Column(name = "RECIPE_TIMEOUT")
58     private Integer recipeTimeout;
59
60     @BusinessKey
61     @Column(name = "VNF_TYPE")
62     private String vnfType;
63
64     @Column(name = "VNF_COMPONENT_PARAM_XSD")
65     private String paramXsd;
66
67     @Column(name = "VNF_COMPONENT_TYPE")
68     private String vnfComponentType;
69
70     @BusinessKey
71     @Column(name = "VF_MODULE_MODEL_UUID")
72     private String vfModuleModelUUID;
73
74     @Override
75     public String toString() {
76         return new ToStringBuilder(this).append("id", id).append("action", action).append("description", description)
77                 .append("orchestrationUri", orchestrationUri).append("recipeTimeout", recipeTimeout)
78                 .append("vnfType", vnfType).append("paramXsd", paramXsd).append("vnfComponentType", vnfComponentType)
79                 .append("vfModuleModelUUID", vfModuleModelUUID).toString();
80     }
81
82     @Override
83     public boolean equals(final Object other) {
84         if (!(other instanceof VnfComponentsRecipe)) {
85             return false;
86         }
87         VnfComponentsRecipe castOther = (VnfComponentsRecipe) other;
88         return new EqualsBuilder().append(action, castOther.action).append(orchestrationUri, castOther.orchestrationUri)
89                 .append(vnfType, castOther.vnfType).append(vfModuleModelUUID, castOther.vfModuleModelUUID).isEquals();
90     }
91
92     @Override
93     public int hashCode() {
94         return new HashCodeBuilder().append(action).append(orchestrationUri).append(vnfType).append(vfModuleModelUUID)
95                 .toHashCode();
96     }
97
98     @Override
99     public Integer getId() {
100         return id;
101     }
102
103     public void setId(Integer id) {
104         this.id = id;
105     }
106
107     @Override
108     public String getAction() {
109         return action;
110     }
111
112     public void setAction(String action) {
113         this.action = action;
114     }
115
116     @Override
117     public String getDescription() {
118         return description;
119     }
120
121     public void setDescription(String description) {
122         this.description = description;
123     }
124
125     public void setOrchestrationUri(String orchestrationUri) {
126         this.orchestrationUri = orchestrationUri;
127     }
128
129     public void setRecipeTimeout(Integer recipeTimeout) {
130         this.recipeTimeout = recipeTimeout;
131     }
132
133     public String getVnfType() {
134         return vnfType;
135     }
136
137     public void setVnfType(String vnfType) {
138         this.vnfType = vnfType;
139     }
140
141     @Override
142     public String getParamXsd() {
143         return paramXsd;
144     }
145
146     public void setParamXsd(String paramXsd) {
147         this.paramXsd = paramXsd;
148     }
149
150     public String getVnfComponentType() {
151         return vnfComponentType;
152     }
153
154     public void setVnfComponentType(String vnfComponentType) {
155         this.vnfComponentType = vnfComponentType;
156     }
157
158     public String getVfModuleModelUUID() {
159         return vfModuleModelUUID;
160     }
161
162     public void setVfModuleModelUUID(String vfModuleModelUUID) {
163         this.vfModuleModelUUID = vfModuleModelUUID;
164     }
165
166     @Override
167     public String getOrchestrationUri() {
168         return orchestrationUri;
169     }
170
171     @Override
172     public Integer getRecipeTimeout() {
173         return recipeTimeout;
174     }
175 }