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.macro;
23 import java.io.Serializable;
24 import java.util.List;
25 import javax.persistence.CascadeType;
26 import javax.persistence.Column;
27 import javax.persistence.Entity;
28 import javax.persistence.FetchType;
29 import javax.persistence.GeneratedValue;
30 import javax.persistence.GenerationType;
31 import javax.persistence.Id;
32 import javax.persistence.OneToMany;
33 import javax.persistence.Table;
34 import org.apache.commons.lang3.builder.EqualsBuilder;
35 import org.apache.commons.lang3.builder.HashCodeBuilder;
36 import org.apache.commons.lang3.builder.ToStringBuilder;
37 import com.openpojo.business.annotation.BusinessKey;
38 import uk.co.blackpepper.bowman.annotation.LinkedResource;
41 @Table(name = "northbound_request_ref_lookup")
42 public class NorthBoundRequest implements Serializable {
47 private static final long serialVersionUID = -2238991039015148725L;
51 @GeneratedValue(strategy = GenerationType.IDENTITY)
55 @Column(name = "MACRO_ACTION")
56 private String macroAction;
59 @Column(name = "ACTION")
60 private String action;
63 @Column(name = "REQUEST_SCOPE")
64 private String requestScope;
67 @Column(name = "IS_ALACARTE")
68 private Boolean isAlacarte;
71 @Column(name = "IS_TOPLEVELFLOW")
72 private Boolean isToplevelflow;
75 @Column(name = "MIN_API_VERSION")
76 private Double minApiVersion;
79 @Column(name = "MAX_API_VERSION")
80 private Double maxApiVersion;
83 @Column(name = "CLOUD_OWNER")
84 private String cloudOwner;
87 @Column(name = "SERVICE_TYPE")
88 private String serviceType;
90 @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "northBoundRequest")
91 private List<OrchestrationFlow> orchestrationFlowList;
94 public String toString() {
95 return new ToStringBuilder(this).append("id", id).append("action", action).append("requestScope", requestScope)
96 .append("isAlacarte", isAlacarte).append("isToplevelflow", isToplevelflow)
97 .append("minApiVersion", minApiVersion).append("maxApiVersion", maxApiVersion)
98 .append("cloudOwner", cloudOwner).append("serviceType", serviceType).toString();
102 public boolean equals(final Object other) {
103 if (!(other instanceof NorthBoundRequest)) {
106 NorthBoundRequest castOther = (NorthBoundRequest) other;
107 return new EqualsBuilder().append(action, castOther.action).append(requestScope, castOther.requestScope)
108 .append(isAlacarte, castOther.isAlacarte).append(isToplevelflow, castOther.isToplevelflow)
109 .append(minApiVersion, castOther.minApiVersion).append(maxApiVersion, castOther.maxApiVersion)
110 .append(cloudOwner, castOther.cloudOwner).append(serviceType, castOther.serviceType).isEquals();
114 public int hashCode() {
115 return new HashCodeBuilder().append(action).append(requestScope).append(isAlacarte).append(isToplevelflow)
116 .append(minApiVersion).append(maxApiVersion).append(cloudOwner).append(serviceType).toHashCode();
119 public Integer getId() {
123 public void setId(Integer id) {
127 public String getAction() {
131 public void setAction(String action) {
132 this.action = action;
135 public String getMacroAction() {
139 public void setMacroAction(String macroAction) {
140 this.macroAction = macroAction;
143 public String getRequestScope() {
147 public void setRequestScope(String requestScope) {
148 this.requestScope = requestScope;
151 public Boolean getIsAlacarte() {
155 public void setIsAlacarte(Boolean isAlacarte) {
156 this.isAlacarte = isAlacarte;
159 public Boolean getIsToplevelflow() {
160 return isToplevelflow;
163 public void setIsToplevelflow(Boolean isToplevelflow) {
164 this.isToplevelflow = isToplevelflow;
167 public Double getMinApiVersion() {
168 return minApiVersion;
171 public void setMinApiVersion(Double minApiVersion) {
172 this.minApiVersion = minApiVersion;
175 public Double getMaxApiVersion() {
176 return maxApiVersion;
179 public void setMaxApiVersion(Double maxApiVersion) {
180 this.maxApiVersion = maxApiVersion;
183 public String getCloudOwner() {
187 public void setCloudOwner(String cloudOwner) {
188 this.cloudOwner = cloudOwner;
191 public String getServiceType() {
195 public void setServiceType(String serviceType) {
196 this.serviceType = serviceType;
200 public List<OrchestrationFlow> getOrchestrationFlowList() {
201 return orchestrationFlowList;
204 public void setOrchestrationFlowList(List<OrchestrationFlow> orchestrationFlowList) {
205 this.orchestrationFlowList = orchestrationFlowList;