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;
26 import javax.persistence.CascadeType;
27 import javax.persistence.Column;
28 import javax.persistence.Entity;
29 import javax.persistence.FetchType;
30 import javax.persistence.GeneratedValue;
31 import javax.persistence.GenerationType;
32 import javax.persistence.Id;
33 import javax.persistence.OneToMany;
34 import javax.persistence.Table;
36 import org.apache.commons.lang3.builder.EqualsBuilder;
37 import org.apache.commons.lang3.builder.HashCodeBuilder;
38 import org.apache.commons.lang3.builder.ToStringBuilder;
40 import com.openpojo.business.annotation.BusinessKey;
42 import uk.co.blackpepper.bowman.annotation.LinkedResource;
45 @Table(name = "northbound_request_ref_lookup")
46 public class NorthBoundRequest implements Serializable {
51 private static final long serialVersionUID = -2238991039015148725L;
55 @GeneratedValue(strategy = GenerationType.IDENTITY)
59 @Column(name = "MACRO_ACTION")
60 private String macroAction;
63 @Column(name = "ACTION")
64 private String action;
67 @Column(name = "REQUEST_SCOPE")
68 private String requestScope;
71 @Column(name = "IS_ALACARTE")
72 private Boolean isAlacarte;
75 @Column(name = "IS_TOPLEVELFLOW")
76 private Boolean isToplevelflow;
79 @Column(name = "MIN_API_VERSION")
80 private Double minApiVersion;
83 @Column(name = "MAX_API_VERSION")
84 private Double maxApiVersion;
87 @Column(name = "CLOUD_OWNER")
88 private String cloudOwner;
91 @Column(name = "SERVICE_TYPE")
92 private String serviceType;
94 @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "northBoundRequest")
95 private List<OrchestrationFlow> orchestrationFlowList;
98 public String toString() {
99 return new ToStringBuilder(this).append("id", id).append("action", action).append("requestScope", requestScope)
100 .append("isAlacarte", isAlacarte).append("isToplevelflow", isToplevelflow)
101 .append("minApiVersion", minApiVersion).append("maxApiVersion", maxApiVersion)
102 .append("cloudOwner",cloudOwner).append("serviceType",serviceType).toString();
106 public boolean equals(final Object other) {
107 if (!(other instanceof NorthBoundRequest)) {
110 NorthBoundRequest castOther = (NorthBoundRequest) other;
111 return new EqualsBuilder().append(action, castOther.action).append(requestScope, castOther.requestScope)
112 .append(isAlacarte, castOther.isAlacarte).append(isToplevelflow, castOther.isToplevelflow)
113 .append(minApiVersion, castOther.minApiVersion).append(maxApiVersion, castOther.maxApiVersion)
114 .append(cloudOwner, castOther.cloudOwner).append(serviceType, castOther.serviceType)
119 public int hashCode() {
120 return new HashCodeBuilder().append(action).append(requestScope).append(isAlacarte).append(isToplevelflow)
121 .append(minApiVersion).append(maxApiVersion).append(cloudOwner).append(serviceType).toHashCode();
124 public Integer getId() {
128 public void setId(Integer id) {
132 public String getAction() {
136 public void setAction(String action) {
137 this.action = action;
140 public String getMacroAction() {
144 public void setMacroAction(String macroAction) {
145 this.macroAction = macroAction;
148 public String getRequestScope() {
152 public void setRequestScope(String requestScope) {
153 this.requestScope = requestScope;
156 public Boolean getIsAlacarte() {
160 public void setIsAlacarte(Boolean isAlacarte) {
161 this.isAlacarte = isAlacarte;
164 public Boolean getIsToplevelflow() {
165 return isToplevelflow;
168 public void setIsToplevelflow(Boolean isToplevelflow) {
169 this.isToplevelflow = isToplevelflow;
172 public Double getMinApiVersion() {
173 return minApiVersion;
176 public void setMinApiVersion(Double minApiVersion) {
177 this.minApiVersion = minApiVersion;
180 public Double getMaxApiVersion() {
181 return maxApiVersion;
184 public void setMaxApiVersion(Double maxApiVersion) {
185 this.maxApiVersion = maxApiVersion;
188 public String getCloudOwner() {
192 public void setCloudOwner(String cloudOwner) {
193 this.cloudOwner = cloudOwner;
196 public String getServiceType() {
200 public void setServiceType(String serviceType) {
201 this.serviceType = serviceType;
205 public List<OrchestrationFlow> getOrchestrationFlowList() {
206 return orchestrationFlowList;
209 public void setOrchestrationFlowList(List<OrchestrationFlow> orchestrationFlowList) {
210 this.orchestrationFlowList = orchestrationFlowList;