e7d069fd23b415b1441cfbdc16dad1bb0a881e55
[aai/sparky-be.git] / src / main / java / org / openecomp / sparky / viewandinspect / entity / GraphMeta.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.openecomp.sparky.viewandinspect.entity;
24
25 import org.openecomp.sparky.viewandinspect.EntityTypeAggregation;
26
27 /**
28  * The Class GraphMeta.
29  */
30 public class GraphMeta {
31
32   private com.fasterxml.jackson.databind.JsonNode aaiEntityNodeDescriptors;
33
34   private int numNodes;
35
36   private int numLinks;
37
38   private long renderTimeInMs;
39
40   private int numLinksResolvedSuccessfullyFromCache;
41
42   private int numLinksResolvedSuccessfullyFromServer;
43
44   private int numLinkResolveFailed;
45
46   private EntityTypeAggregation entitySummary;
47
48   /**
49    * Instantiates a new graph meta.
50    */
51   public GraphMeta() {
52     entitySummary = new EntityTypeAggregation();
53   }
54
55   public EntityTypeAggregation getEntitySummary() {
56     return entitySummary;
57   }
58
59   public void setEntitySummary(EntityTypeAggregation entitySummary) {
60     this.entitySummary = entitySummary;
61   }
62
63   public com.fasterxml.jackson.databind.JsonNode getAaiEntityNodeDescriptors() {
64     return aaiEntityNodeDescriptors;
65   }
66
67   public void setAaiEntityNodeDescriptors(
68       com.fasterxml.jackson.databind.JsonNode aaiEntityNodeDefinitions) {
69     this.aaiEntityNodeDescriptors = aaiEntityNodeDefinitions;
70   }
71
72   public int getNumLinksResolvedSuccessfullyFromCache() {
73     return numLinksResolvedSuccessfullyFromCache;
74   }
75
76   public void setNumLinksResolvedSuccessfullyFromCache(int numLinksResolvedSuccessfullyFromCache) {
77     this.numLinksResolvedSuccessfullyFromCache = numLinksResolvedSuccessfullyFromCache;
78   }
79
80   public int getNumLinksResolvedSuccessfullyFromServer() {
81     return numLinksResolvedSuccessfullyFromServer;
82   }
83
84   public void setNumLinksResolvedSuccessfullyFromServer(
85       int numLinksResolvedSuccessfullyFromServer) {
86     this.numLinksResolvedSuccessfullyFromServer = numLinksResolvedSuccessfullyFromServer;
87   }
88
89   public int getNumLinkResolveFailed() {
90     return numLinkResolveFailed;
91   }
92
93   public void setNumLinkResolveFailed(int numLinkResolveFailed) {
94     this.numLinkResolveFailed = numLinkResolveFailed;
95   }
96
97   public int getNumNodes() {
98     return numNodes;
99   }
100
101   public void setNumNodes(int numNodes) {
102     this.numNodes = numNodes;
103   }
104
105   public int getNumLinks() {
106     return numLinks;
107   }
108
109   public void setNumLinks(int numLinks) {
110     this.numLinks = numLinks;
111   }
112
113   public long getRenderTimeInMs() {
114     return renderTimeInMs;
115   }
116
117   public void setRenderTimeInMs(long renderTimeInMs) {
118     this.renderTimeInMs = renderTimeInMs;
119   }
120
121   /**
122    * Peg counter.
123    *
124    * @param counterName the counter name
125    */
126   public void pegCounter(String counterName) {
127     entitySummary.pegCounter(counterName);
128   }
129
130   /* (non-Javadoc)
131    * @see java.lang.Object#toString()
132    */
133   @Override
134   public String toString() {
135     return "GraphMeta ["
136         + (aaiEntityNodeDescriptors != null
137             ? "aaiEntityNodeDescriptors=" + aaiEntityNodeDescriptors + ", " : "")
138         + "numNodes=" + numNodes + ", numLinks=" + numLinks + ", renderTimeInMs=" + renderTimeInMs
139         + ", numLinksResolvedSuccessfullyFromCache=" + numLinksResolvedSuccessfullyFromCache
140         + ", numLinksResolvedSuccessfullyFromServer=" + numLinksResolvedSuccessfullyFromServer
141         + ", numLinkResolveFailed=" + numLinkResolveFailed + ", "
142         + (entitySummary != null ? "entitySummary=" + entitySummary : "") + "]";
143   }
144
145 }