2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-18 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Modifications Copyright (C) 2019 Ericsson
8 * =============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
21 * ============LICENSE_END=========================================================
24 package org.onap.appc.flow.controller.data;
26 import java.util.List;
27 import com.fasterxml.jackson.annotation.JsonProperty;
29 public class Transaction {
31 @JsonProperty("transaction-id")
32 private int transactionId ;
34 @JsonProperty("action")
35 private String action ;
37 @JsonProperty("action-level")
38 private String actionLevel ;
40 @JsonProperty("action-identifier")
41 private ActionIdentifier actionIdentifier ;
43 @JsonProperty("parameters")
44 private List<Parameters> parameters ;
46 private String executionType;
50 private String statusCode;
54 private String executionEndPoint;
56 private String executionModule;
58 private String executionRPC;
60 @JsonProperty("state")
63 @JsonProperty("precheck")
64 private PreCheck precheck;
66 @JsonProperty("payload")
67 private String payload ;
69 @JsonProperty("responses")
70 private List<Response> responses ;
73 private String status = "PENDING";
75 public String getuId() {
79 public void setuId(String uId) {
83 public String getPswd() {
87 public void setPswd(String pswd) {
91 public String getExecutionEndPoint() {
92 return executionEndPoint;
95 public void setExecutionEndPoint(String executionEndPoint) {
96 this.executionEndPoint = executionEndPoint;
100 public String getExecutionType() {
101 return executionType;
104 public void setExecutionType(String executionType) {
105 this.executionType = executionType;
108 public String getExecutionModule() {
109 return executionModule;
113 public void setExecutionModule(String executionModule) {
114 this.executionModule = executionModule;
118 public String getExecutionRPC() {
123 public void setExecutionRPC(String executionRPC) {
124 this.executionRPC = executionRPC;
128 public List<Parameters> getParameters() {
133 public void setParameters(List<Parameters> parameters) {
134 this.parameters = parameters;
137 public String getState() {
141 public void setState(String state) {
145 public PreCheck getPrecheck() {
149 public void setPrecheck(PreCheck precheck) {
150 this.precheck = precheck;
153 public String getStatus() {
158 public void setStatus(String status) {
159 this.status = status;
162 public List<Response> getResponses() {
167 public void setResponses(List<Response> responses) {
168 this.responses = responses;
171 public int getTransactionId() {
172 return transactionId;
176 public void setTransactionId(int transactionId) {
177 this.transactionId = transactionId;
181 public String getAction() {
186 public void setAction(String action) {
187 this.action = action;
191 public String getActionLevel() {
196 public void setActionLevel(String actionLevel) {
197 this.actionLevel = actionLevel;
202 public String getPayload() {
207 public void setPayload(String payload) {
208 this.payload = payload;
212 public ActionIdentifier getActionIdentifier() {
213 return actionIdentifier;
217 public void setActionIdentifier(ActionIdentifier actionIdentifier) {
218 this.actionIdentifier = actionIdentifier;
221 public String getStatusCode() {
225 public void setStatusCode(String statusCode) {
226 this.statusCode = statusCode;
230 public String toString() {
231 return "Transaction [transactionId=" + transactionId + ", action=" + action + ", actionLevel=" + actionLevel
232 + ", actionIdentifier=" + actionIdentifier + ", parameters=" + parameters + ", executionType="
233 + executionType + ", uId=" + uId + ", statusCode=" + statusCode + ", pswd=" + pswd
234 + ", executionEndPoint=" + executionEndPoint + ", executionModule=" + executionModule
235 + ", executionRPC=" + executionRPC + ", state=" + state + ", precheck=" + precheck + ", payload="
236 + payload + ", responses=" + responses + ", status=" + status + "]";
240 public int hashCode() {
241 final int prime = 31;
243 result = prime * result + ((action == null) ? 0 : action.hashCode());
244 result = prime * result + ((actionIdentifier == null) ? 0 : actionIdentifier.hashCode());
245 result = prime * result + ((actionLevel == null) ? 0 : actionLevel.hashCode());
246 result = prime * result + ((executionEndPoint == null) ? 0 : executionEndPoint.hashCode());
247 result = prime * result + ((executionModule == null) ? 0 : executionModule.hashCode());
248 result = prime * result + ((executionRPC == null) ? 0 : executionRPC.hashCode());
249 result = prime * result + ((executionType == null) ? 0 : executionType.hashCode());
250 result = prime * result + ((parameters == null) ? 0 : parameters.hashCode());
251 result = prime * result + ((payload == null) ? 0 : payload.hashCode());
252 result = prime * result + ((precheck == null) ? 0 : precheck.hashCode());
253 result = prime * result + ((pswd == null) ? 0 : pswd.hashCode());
254 result = prime * result + ((responses == null) ? 0 : responses.hashCode());
255 result = prime * result + ((state == null) ? 0 : state.hashCode());
256 result = prime * result + ((status == null) ? 0 : status.hashCode());
257 result = prime * result + ((statusCode == null) ? 0 : statusCode.hashCode());
258 result = prime * result + transactionId;
259 result = prime * result + ((uId == null) ? 0 : uId.hashCode());
264 public boolean equals(Object obj) {
269 if (getClass() != obj.getClass())
271 Transaction other = (Transaction) obj;
272 if (action == null) {
273 if (other.action != null)
275 } else if (!action.equals(other.action))
277 if (actionIdentifier == null) {
278 if (other.actionIdentifier != null)
280 } else if (!actionIdentifier.equals(other.actionIdentifier))
282 if (actionLevel == null) {
283 if (other.actionLevel != null)
285 } else if (!actionLevel.equals(other.actionLevel))
287 if (executionEndPoint == null) {
288 if (other.executionEndPoint != null)
290 } else if (!executionEndPoint.equals(other.executionEndPoint))
292 if (executionModule == null) {
293 if (other.executionModule != null)
295 } else if (!executionModule.equals(other.executionModule))
297 if (executionRPC == null) {
298 if (other.executionRPC != null)
300 } else if (!executionRPC.equals(other.executionRPC))
302 if (executionType == null) {
303 if (other.executionType != null)
305 } else if (!executionType.equals(other.executionType))
307 if (parameters == null) {
308 if (other.parameters != null)
310 } else if (!parameters.equals(other.parameters))
312 if (payload == null) {
313 if (other.payload != null)
315 } else if (!payload.equals(other.payload))
317 if (precheck == null) {
318 if (other.precheck != null)
320 } else if (!precheck.equals(other.precheck))
323 if (other.pswd != null)
325 } else if (!pswd.equals(other.pswd))
327 if (responses == null) {
328 if (other.responses != null)
330 } else if (!responses.equals(other.responses))
333 if (other.state != null)
335 } else if (!state.equals(other.state))
337 if (status == null) {
338 if (other.status != null)
340 } else if (!status.equals(other.status))
342 if (statusCode == null) {
343 if (other.statusCode != null)
345 } else if (!statusCode.equals(other.statusCode))
347 if (transactionId != other.transactionId)
350 if (other.uId != null)
352 } else if (!uId.equals(other.uId))