2 * ============LICENSE_START===================================================
3 * SPARKY (AAI UI service)
4 * ============================================================================
5 * Copyright © 2017 AT&T Intellectual Property.
6 * Copyright © 2017 Amdocs
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.
20 * ============LICENSE_END=====================================================
22 * ECOMP and OpenECOMP are trademarks
23 * and service marks of AT&T Intellectual Property.
25 package org.onap.aai.sparky.viewandinspect.entity;
27 import org.onap.aai.restclient.client.OperationResult;
30 * The Class NodeProcessingTransaction.
32 public class NodeProcessingTransaction {
34 private ActiveInventoryNode processingNode;
35 private OperationResult opResult;
36 private String selfLinkWithModifiers;
37 private String requestParameters;
40 * Instantiates a new node processing transaction.
42 public NodeProcessingTransaction() {}
44 public String getRequestParameters() {
45 return requestParameters;
48 public void setRequestParameters(String requestParameters) {
49 this.requestParameters = requestParameters;
52 public String getSelfLink() {
53 if (processingNode == null) {
57 return processingNode.getSelfLink();
60 public String getSelfLinkWithModifiers() {
61 if (processingNode == null) {
65 return processingNode.getSelfLink() + requestParameters;
68 public ActiveInventoryNode getProcessingNode() {
69 return processingNode;
72 public void setProcessingNode(ActiveInventoryNode processingNode) {
73 this.processingNode = processingNode;
76 public OperationResult getOpResult() {
80 public void setOpResult(OperationResult opResult) {
81 this.opResult = opResult;
85 * Processing error occurred.
87 * @return true, if successful
89 public boolean processingErrorOccurred() {
90 if (opResult == null) {
94 return !opResult.wasSuccessful();
99 * @see java.lang.Object#toString()
102 public String toString() {
103 return "NodeProcessingTransaction ["
104 + (processingNode != null ? "processingNode=" + processingNode + ", " : "")
105 + (opResult != null ? "opResult=" + opResult + ", " : "") + "processorErrorOccurred="
106 + processingErrorOccurred() + "]";