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