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.appc.flow.controller.data;
23 import java.io.IOException;
24 import java.util.ArrayList;
25 import java.util.List;
27 import com.fasterxml.jackson.annotation.JsonProperty;
28 import com.fasterxml.jackson.core.JsonGenerationException;
29 import com.fasterxml.jackson.databind.JsonMappingException;
30 import com.fasterxml.jackson.databind.ObjectMapper;
32 public class Transaction {
34 @JsonProperty("transaction-id")
35 private int transactionId ;
37 @JsonProperty("action")
38 private String action ;
40 @JsonProperty("action-level")
41 private String actionLevel ;
43 @JsonProperty("action-identifier")
44 private ActionIdentifier actionIdentifier ;
46 @JsonProperty("parameters")
47 private List<Parameters> parameters ;
49 private String executionType;
53 private String statusCode;
57 private String executionEndPoint;
59 private String executionModule;
61 private String executionRPC;
63 @JsonProperty("state")
66 @JsonProperty("precheck")
67 private PreCheck precheck;
69 @JsonProperty("payload")
70 private String payload ;
72 @JsonProperty("responses")
73 private List<Response> responses ;
76 private String status = "PENDING";
78 public String getuId() {
82 public void setuId(String uId) {
86 public String getPswd() {
90 public void setPswd(String pswd) {
94 public String getExecutionEndPoint() {
95 return executionEndPoint;
98 public void setExecutionEndPoint(String executionEndPoint) {
99 this.executionEndPoint = executionEndPoint;
103 public String getExecutionType() {
104 return executionType;
107 public void setExecutionType(String executionType) {
108 this.executionType = executionType;
111 public String getExecutionModule() {
112 return executionModule;
116 public void setExecutionModule(String executionModule) {
117 this.executionModule = executionModule;
121 public String getExecutionRPC() {
126 public void setExecutionRPC(String executionRPC) {
127 this.executionRPC = executionRPC;
131 public List<Parameters> getParameters() {
136 public void setParameters(List<Parameters> parameters) {
137 this.parameters = parameters;
140 public String getState() {
144 public void setState(String state) {
148 public PreCheck getPrecheck() {
152 public void setPrecheck(PreCheck precheck) {
153 this.precheck = precheck;
156 public String getStatus() {
161 public void setStatus(String status) {
162 this.status = status;
165 public List<Response> getResponses() {
170 public void setResponses(List<Response> responses) {
171 this.responses = responses;
174 public int getTransactionId() {
175 return transactionId;
179 public void setTransactionId(int transactionId) {
180 this.transactionId = transactionId;
184 public String getAction() {
189 public void setAction(String action) {
190 this.action = action;
194 public String getActionLevel() {
199 public void setActionLevel(String actionLevel) {
200 this.actionLevel = actionLevel;
205 public String getPayload() {
210 public void setPayload(String payload) {
211 this.payload = payload;
215 public ActionIdentifier getActionIdentifier() {
216 return actionIdentifier;
220 public void setActionIdentifier(ActionIdentifier actionIdentifier) {
221 this.actionIdentifier = actionIdentifier;
224 public String getStatusCode() {
228 public void setStatusCode(String statusCode) {
229 this.statusCode = statusCode;
233 public String toString() {
234 return "Transaction [transactionId=" + transactionId + ", action=" + action + ", actionLevel=" + actionLevel
235 + ", actionIdentifier=" + actionIdentifier + ", parameters=" + parameters + ", executionType="
236 + executionType + ", uId=" + uId + ", statusCode=" + statusCode + ", pswd=" + pswd
237 + ", executionEndPoint=" + executionEndPoint + ", executionModule=" + executionModule
238 + ", executionRPC=" + executionRPC + ", state=" + state + ", precheck=" + precheck + ", payload="
239 + payload + ", responses=" + responses + ", status=" + status + "]";
243 public int hashCode() {
244 final int prime = 31;
246 result = prime * result + ((action == null) ? 0 : action.hashCode());
247 result = prime * result + ((actionIdentifier == null) ? 0 : actionIdentifier.hashCode());
248 result = prime * result + ((actionLevel == null) ? 0 : actionLevel.hashCode());
249 result = prime * result + ((executionEndPoint == null) ? 0 : executionEndPoint.hashCode());
250 result = prime * result + ((executionModule == null) ? 0 : executionModule.hashCode());
251 result = prime * result + ((executionRPC == null) ? 0 : executionRPC.hashCode());
252 result = prime * result + ((executionType == null) ? 0 : executionType.hashCode());
253 result = prime * result + ((parameters == null) ? 0 : parameters.hashCode());
254 result = prime * result + ((payload == null) ? 0 : payload.hashCode());
255 result = prime * result + ((precheck == null) ? 0 : precheck.hashCode());
256 result = prime * result + ((pswd == null) ? 0 : pswd.hashCode());
257 result = prime * result + ((responses == null) ? 0 : responses.hashCode());
258 result = prime * result + ((state == null) ? 0 : state.hashCode());
259 result = prime * result + ((status == null) ? 0 : status.hashCode());
260 result = prime * result + ((statusCode == null) ? 0 : statusCode.hashCode());
261 result = prime * result + transactionId;
262 result = prime * result + ((uId == null) ? 0 : uId.hashCode());
267 public boolean equals(Object obj) {
272 if (getClass() != obj.getClass())
274 Transaction other = (Transaction) obj;
275 if (action == null) {
276 if (other.action != null)
278 } else if (!action.equals(other.action))
280 if (actionIdentifier == null) {
281 if (other.actionIdentifier != null)
283 } else if (!actionIdentifier.equals(other.actionIdentifier))
285 if (actionLevel == null) {
286 if (other.actionLevel != null)
288 } else if (!actionLevel.equals(other.actionLevel))
290 if (executionEndPoint == null) {
291 if (other.executionEndPoint != null)
293 } else if (!executionEndPoint.equals(other.executionEndPoint))
295 if (executionModule == null) {
296 if (other.executionModule != null)
298 } else if (!executionModule.equals(other.executionModule))
300 if (executionRPC == null) {
301 if (other.executionRPC != null)
303 } else if (!executionRPC.equals(other.executionRPC))
305 if (executionType == null) {
306 if (other.executionType != null)
308 } else if (!executionType.equals(other.executionType))
310 if (parameters == null) {
311 if (other.parameters != null)
313 } else if (!parameters.equals(other.parameters))
315 if (payload == null) {
316 if (other.payload != null)
318 } else if (!payload.equals(other.payload))
320 if (precheck == null) {
321 if (other.precheck != null)
323 } else if (!precheck.equals(other.precheck))
326 if (other.pswd != null)
328 } else if (!pswd.equals(other.pswd))
330 if (responses == null) {
331 if (other.responses != null)
333 } else if (!responses.equals(other.responses))
336 if (other.state != null)
338 } else if (!state.equals(other.state))
340 if (status == null) {
341 if (other.status != null)
343 } else if (!status.equals(other.status))
345 if (statusCode == null) {
346 if (other.statusCode != null)
348 } else if (!statusCode.equals(other.statusCode))
350 if (transactionId != other.transactionId)
353 if (other.uId != null)
355 } else if (!uId.equals(other.uId))