2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017-2018 Amdocs
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
21 package org.onap.aai.sparky.viewandinspect.entity;
23 import org.onap.aai.restclient.client.OperationResult;
26 * The Class NodeProcessingTransaction.
28 public class NodeProcessingTransaction {
30 private ActiveInventoryNode processingNode;
31 private OperationResult opResult;
32 private String selfLinkWithModifiers;
33 private String requestParameters;
36 * Instantiates a new node processing transaction.
38 public NodeProcessingTransaction() {}
40 public String getRequestParameters() {
41 return requestParameters;
44 public void setRequestParameters(String requestParameters) {
45 this.requestParameters = requestParameters;
48 public String getSelfLink() {
49 if (processingNode == null) {
53 return processingNode.getSelfLink();
56 public String getSelfLinkWithModifiers() {
57 if (processingNode == null) {
61 return processingNode.getSelfLink() + requestParameters;
64 public ActiveInventoryNode getProcessingNode() {
65 return processingNode;
68 public void setProcessingNode(ActiveInventoryNode processingNode) {
69 this.processingNode = processingNode;
72 public OperationResult getOpResult() {
76 public void setOpResult(OperationResult opResult) {
77 this.opResult = opResult;
81 * Processing error occurred.
83 * @return true, if successful
85 public boolean processingErrorOccurred() {
86 if (opResult == null) {
90 return !opResult.wasSuccessful();
95 * @see java.lang.Object#toString()
98 public String toString() {
99 return "NodeProcessingTransaction ["
100 + (processingNode != null ? "processingNode=" + processingNode + ", " : "")
101 + (opResult != null ? "opResult=" + opResult + ", " : "") + "processorErrorOccurred="
102 + processingErrorOccurred() + "]";