Merge "Fix Blocker/Critical sonar issues"
[aai/sparky-be.git] / src / main / java / org / onap / aai / sparky / viewandinspect / entity / NodeMeta.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6  * Copyright © 2017 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
11  *
12  *       http://www.apache.org/licenses/LICENSE-2.0
13  *
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=========================================================
20  *
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  */
23 package org.onap.aai.sparky.viewandinspect.entity;
24
25 import org.onap.aai.sparky.viewandinspect.config.VisualizationConfig;
26 import org.onap.aai.sparky.viewandinspect.enumeration.NodeProcessingState;
27
28 /**
29  * The Class NodeMeta.
30  */
31 public class NodeMeta {
32
33   private String className;
34
35   private boolean isEnrichableNode;
36   private boolean isSearchTarget;
37
38   private NodeDebug nodeDebug;
39   private boolean nodeIssue;
40   private boolean nodeValidated;
41   private long selfLinkResponseTimeInMs;
42   private long numInboundNeighbors;
43   private long numOutboundNeighbors;
44
45   private boolean atMaxDepth;
46   private boolean selfLinkResolved;
47   private boolean processingErrorOccurred;
48   private boolean neighborsProcessed;
49   private int nodeDepth;
50   private boolean hasNeighbors;
51
52   private NodeProcessingState processingState;
53
54   /**
55    * Instantiates a new node meta.
56    */
57   public NodeMeta() {
58     this.isSearchTarget = false;
59     this.isEnrichableNode = false;
60
61     if (VisualizationConfig.getConfig().isVisualizationDebugEnabled()) {
62       nodeDebug = new NodeDebug();
63     }
64     this.numInboundNeighbors = 0;
65     this.numOutboundNeighbors = 0;
66
67     this.selfLinkResponseTimeInMs = 0;
68
69     this.atMaxDepth = false;
70     this.selfLinkResolved = false;
71     this.processingErrorOccurred = false;
72     this.hasNeighbors = false;
73     this.neighborsProcessed = false;
74     this.nodeDepth = ActiveInventoryNode.DEFAULT_INIT_NODE_DEPTH;
75     this.processingState = NodeProcessingState.INIT;
76
77   }
78
79   public boolean isAtMaxDepth() {
80     return atMaxDepth;
81   }
82
83   public void setAtMaxDepth(boolean atMaxDepth) {
84     this.atMaxDepth = atMaxDepth;
85   }
86
87   public boolean isSelfLinkResolved() {
88     return selfLinkResolved;
89   }
90
91
92
93   public NodeProcessingState getProcessingState() {
94     return processingState;
95   }
96
97   public void setProcessingState(NodeProcessingState processingState) {
98     this.processingState = processingState;
99   }
100
101   public void setSelfLinkResolved(boolean selfLinkResolved) {
102     this.selfLinkResolved = selfLinkResolved;
103   }
104
105   public boolean isProcessingErrorOccurred() {
106     return processingErrorOccurred;
107   }
108
109   public void setProcessingErrorOccurred(boolean processingErrorOccurred) {
110     this.processingErrorOccurred = processingErrorOccurred;
111   }
112
113   public boolean isHasNeighbors() {
114     return hasNeighbors;
115   }
116
117   public void setHasNeighbors(boolean hasNeighbors) {
118     this.hasNeighbors = hasNeighbors;
119   }
120
121   public boolean isNeighborsProcessed() {
122     return neighborsProcessed;
123   }
124
125   public void setNeighborsProcessed(boolean neighborsProcessed) {
126     this.neighborsProcessed = neighborsProcessed;
127   }
128
129   public int getNodeDepth() {
130     return nodeDepth;
131   }
132
133   public void setNodeDepth(int nodeDepth) {
134     this.nodeDepth = nodeDepth;
135   }
136
137   public void setNodeDebug(NodeDebug nodeDebug) {
138     this.nodeDebug = nodeDebug;
139   }
140
141   public String getClassName() {
142     return className;
143   }
144
145   public long getNumInboundNeighbors() {
146     return numInboundNeighbors;
147   }
148
149   public void setNumInboundNeighbors(long numInboundNeighbors) {
150     this.numInboundNeighbors = numInboundNeighbors;
151   }
152
153   public long getNumOutboundNeighbors() {
154     return numOutboundNeighbors;
155   }
156
157   public void setNumOutboundNeighbors(long numOutboundNeighbors) {
158     this.numOutboundNeighbors = numOutboundNeighbors;
159   }
160
161   public NodeDebug getNodeDebug() {
162     return nodeDebug;
163   }
164
165   public long getSelfLinkResponseTimeInMs() {
166     return selfLinkResponseTimeInMs;
167   }
168
169   public boolean isEnrichableNode() {
170     return isEnrichableNode;
171   }
172
173   public boolean isNodeIssue() {
174     return nodeIssue;
175   }
176
177   public boolean isNodeValidated() {
178     return nodeValidated;
179   }
180
181   public boolean isSearchTarget() {
182     return isSearchTarget;
183   }
184
185   public void setClassName(String className) {
186     this.className = className;
187   }
188
189   public void setEnrichableNode(boolean isEnrichableNode) {
190     this.isEnrichableNode = isEnrichableNode;
191   }
192
193   public void setNodeIssue(boolean nodeIssue) {
194     this.nodeIssue = nodeIssue;
195   }
196
197   public void setNodeValidated(boolean nodeValidated) {
198     this.nodeValidated = nodeValidated;
199   }
200
201   public void setSearchTarget(boolean isSearchTarget) {
202     this.isSearchTarget = isSearchTarget;
203   }
204
205   public void setSelfLinkResponseTimeInMs(long selfLinkResponseTimeInMs) {
206     this.selfLinkResponseTimeInMs = selfLinkResponseTimeInMs;
207   }
208
209 }