Add changes to basic structure of api component
[policy/api.git] / main / src / main / java / org / onap / policy / api / main / rest / StatisticsReport.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP Policy API 
4  * ================================================================================ 
5  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  * SPDX-License-Identifier: Apache-2.0
20  * ============LICENSE_END=========================================================
21  */
22
23 package org.onap.policy.api.main.rest;
24
25 /**
26  * Class to represent API statistics report.
27  */
28 public class StatisticsReport {
29     
30     private int code;
31     private long totalApiCallCount;
32     private long apiCallSuccessCount;
33     private long apiCallFailureCount;
34     private long totalPolicyGetCount;
35     private long totalPolicyPostCount;
36     private long totalTemplateGetCount;
37     private long totalTemplatePostCount;
38     private long policyGetSuccessCount;
39     private long policyGetFailureCount;
40     private long policyPostSuccessCount;
41     private long policyPostFailureCount;
42     private long templateGetSuccessCount;
43     private long templateGetFailureCount;
44     private long templatePostSuccessCount;
45     private long templatePostFailureCount;
46     
47     /**
48      * Returns the code of this {@link StatisticsReport} instance.
49      *
50      * @return the code
51      */
52     public int getCode() {
53         return code;
54     }
55     
56     /**
57      * Set code in this {@link StatisticsReport} instance.
58      *
59      * @param code the code to set
60      */
61     public void setCode(final int code) {
62         this.code = code;
63     }
64     
65     /**
66      * Returns the totalApiCallCount of this {@link StatisticsReport} instance.
67      * 
68      * @return the totalApiCallCount
69      */
70     public long getTotalApiCallCount() {
71         return totalApiCallCount;
72     }
73     
74     /**
75      * Set totalApiCallCount in this {@link StatisticsReport} instance.
76      * 
77      * @param totalApiCallCount the totalApiCallCount to set
78      */
79     public void setTotalApiCallCount(final long totalApiCallCount) {
80         this.totalApiCallCount = totalApiCallCount;
81     }
82    
83     /**
84      * Returns the apiCallSuccessCount of this {@link StatisticsReport} instance.
85      * 
86      * @return the apiCallSuccessCount
87      */
88     public long getApiCallSuccessCount() {
89         return apiCallSuccessCount;
90     }
91     
92     /**
93      * Set apiCallSuccessCount in this {@link StatisticsReport} instance.
94      * 
95      * @param apiCallSuccessCount the apiCallSuccessCount to set
96      */
97     public void setApiCallSuccessCount(final long apiCallSuccessCount) {
98         this.apiCallSuccessCount = apiCallSuccessCount;
99     }
100     
101     /**
102      * Returns the apiCallFailureCount of this {@link StatisticsReport} instance.
103      * 
104      * @return the apiCallFailureCount
105      */
106     public long getApiCallFailureCount() {
107         return apiCallFailureCount;
108     } 
109     
110     /**
111      * Set apiCallFailureCount in this {@link StatisticsReport} instance.
112      * 
113      * @param apiCallFailureCount the apiCallFailureCount to set
114      */
115     public void setApiCallFailureCount(final long apiCallFailureCount) {
116         this.apiCallFailureCount = apiCallFailureCount;
117     }
118     
119     /**
120      * Returns the totalPolicyGetCount of this {@link StatisticsReport} instance.
121      * 
122      * @return the totalPolicyGetCount
123      */
124     public long getTotalPolicyGetCount() {
125         return totalPolicyGetCount;
126     }
127     
128     /**
129      * Set totalPolicyGetCount in this {@link StatisticsReport} instance.
130      * 
131      * @param totalPolicyGetCount the totalPolicyGetCount to set
132      */
133     public void setTotalPolicyGetCount(final long totalPolicyGetCount) {
134         this.totalPolicyGetCount = totalPolicyGetCount;
135     }
136     
137     /**
138      * Returns the totalPolicyPostCount of this {@link StatisticsReport} instance.
139      * 
140      * @return the totalPolicyPostCount
141      */
142     public long getTotalPolicyPostCount() {
143         return totalPolicyPostCount;
144     } 
145     
146     /**
147      * Set totalPolicyPostCount in this {@link StatisticsReport} instance.
148      * 
149      * @param totalPolicyPostCount the totalPolicyPostCount to set
150      */
151     public void setTotalPolicyPostCount(final long totalPolicyPostCount) {
152         this.totalPolicyPostCount = totalPolicyPostCount;
153     }
154     
155     /**
156      * Returns the totalTemplateGetCount of this {@link StatisticsReport} instance.
157      * 
158      * @return the totalTemplateGetCount
159      */
160     public long getTotalTemplateGetCount() {
161         return totalTemplateGetCount;
162     }
163     
164     /**
165      * Set totalTemplateGetCount in this {@link StatisticsReport} instance.
166      * 
167      * @param totalTemplateGetCount the totalTemplateGetCount to set
168      */
169     public void setTotalTemplateGetCount(final long totalTemplateGetCount) {
170         this.totalTemplateGetCount = totalTemplateGetCount;
171     }
172     
173     /**
174      * Returns the totalTemplatePostCount of this {@link StatisticsReport} instance.
175      * 
176      * @return the totalTemplatePostCount
177      */
178     public long getTotalTemplatePostCount() {
179         return totalTemplatePostCount;
180     }
181     
182     /**
183      * Set totalTemplatePostCount in this {@link StatisticsReport} instance.
184      * 
185      * @param totalTemplatePostCount the totalTemplatePostCount to set
186      */
187     public void setTotalTemplatePostCount(final long totalTemplatePostCount) {
188         this.totalTemplatePostCount = totalTemplatePostCount;
189     }
190     
191     /**
192      * Returns the policyGetSuccessCount of this {@link StatisticsReport} instance.
193      * 
194      * @return the policyGetSuccessCount
195      */
196     public long getPolicyGetSuccessCount() {
197         return policyGetSuccessCount;
198     }
199     
200     /**
201      * Set policyGetSuccessCount in this {@link StatisticsReport} instance.
202      * 
203      * @param policyGetSuccessCount the policyGetSuccessCount to set
204      */
205     public void setPolicyGetSuccessCount(final long policyGetSuccessCount) {
206         this.policyGetSuccessCount = policyGetSuccessCount;
207     }
208    
209     /**
210      * Returns the policyGetFailureCount of this {@link StatisticsReport} instance.
211      * 
212      * @return the policyGetFailureCount 
213      */
214     public long getPolicyGetFailureCount() {
215         return policyGetFailureCount;
216     }
217     
218     /**
219      * Set policyGetFailureCount in this {@link StatisticsReport} instance.
220      * 
221      * @param policyGetFailureCount the policyGetFailureCount to set
222      */
223     public void setPolicyGetFailureCount(final long policyGetFailureCount) {
224         this.policyGetFailureCount = policyGetFailureCount;
225     }
226     
227     /**
228      * Returns the policyPostSuccessCount of this {@link StatisticsReport} instance.
229      * 
230      * @return the policyPostSuccessCount
231      */
232     public long getPolicyPostSuccessCount() {
233         return policyPostSuccessCount;
234     }
235     
236     /**
237      * Set policyPostSuccessCount in this {@link StatisticsReport} instance.
238      * 
239      * @param policyPostSuccessCount the policyPostSuccessCount to set
240      */
241     public void setPolicyPostSuccessCount(final long policyPostSuccessCount) {
242         this.policyPostSuccessCount = policyPostSuccessCount;
243     }
244     
245     /**
246      * Returns the policyPostFailureCount of this {@link StatisticsReport} instance.
247      * 
248      * @return the policyPostFailureCount
249      */
250     public long getPolicyPostFailureCount() {
251         return policyPostFailureCount;
252     }
253     
254     /**
255      * Set policyPostFailureCount in this {@link StatisticsReport} instance.
256      * 
257      * @param policyPostFailureCount the policyPostFailureCount to set
258      */
259     public void setPolicyPostFailureCount(final long policyPostFailureCount) {
260         this.policyPostFailureCount = policyPostFailureCount;
261     }
262    
263     /**
264      * Returns the templateGetSuccessCount of this {@link StatisticsReport} instance.
265      * 
266      * @return the templateGetSuccessCount
267      */
268     public long getTemplateGetSuccessCount() {
269         return templateGetSuccessCount;
270     }
271     
272     /**
273      * Set templateGetSuccessCount in this {@link StatisticsReport} instance.
274      *  
275      * @param templateGetSuccessCount the templateGetSuccessCount to set
276      */
277     public void setTemplateGetSuccessCount(final long templateGetSuccessCount) {
278         this.templateGetSuccessCount = templateGetSuccessCount;
279     }
280     
281     /**
282      * Returns the templateGetFailureCount of this {@link StatisticsReport} instance.
283      * 
284      * @return the templateGetFailureCount
285      */
286     public long getTemplateGetFailureCount() {
287         return templateGetFailureCount;
288     }
289     
290     /**
291      * Set templateGetFailureCount in this {@link StatisticsReport} instance.
292      * 
293      * @param templateGetFailureCount the templateGetFailureCount to set
294      */
295     public void setTemplateGetFailureCount(final long templateGetFailureCount) {
296         this.templateGetFailureCount = templateGetFailureCount;
297     }
298     
299     /**
300      * Returns the templatePostSuccessCount of this {@link StatisticsReport} instance.
301      * 
302      * @return the templatePostSuccessCount
303      */
304     public long getTemplatePostSuccessCount() {
305         return templatePostSuccessCount;
306     }
307     
308     /**
309      * Set templatePostSuccessCount in this {@link StatisticsReport} instance.
310      * 
311      * @param templatePostSuccessCount the templatePostSuccessCount to set
312      */
313     public void setTemplatePostSuccessCount(final long templatePostSuccessCount) {
314         this.templatePostSuccessCount = templatePostSuccessCount;
315     }
316     
317     /**
318      * Returns the templatePostFailureCount of this {@link StatisticsReport} instance.
319      * 
320      * @return the templatePostFailureCount
321      */
322     public long getTemplatePostFailureCount() {
323         return templatePostFailureCount;
324     }
325     
326     /**
327      * Set templatePostFailureCount in this {@link StatisticsReport} instance.
328      * 
329      * @param templatePostFailureCount the templatePostFailureCount to set
330      */
331     public void setTemplatePostFailureCount(final long templatePostFailureCount) {
332         this.templatePostFailureCount = templatePostFailureCount;
333     }
334    
335     /**
336      * {@inheritDoc}}.
337      */
338     @Override
339     public String toString() {
340         final StringBuilder builder = new StringBuilder();
341         builder.append("StatisticsReport [code=");
342         builder.append(getCode());
343         builder.append(", totalApiCallCount=");
344         builder.append(getTotalApiCallCount());
345         builder.append(", apiCallSuccessCount=");
346         builder.append(getApiCallSuccessCount());
347         builder.append(", apiCallFailureCount=");
348         builder.append(getApiCallFailureCount());
349         builder.append(", totalPolicyGetCount=");
350         builder.append(getTotalPolicyGetCount());
351         builder.append(", totalPolicyPostCount=");
352         builder.append(getTotalPolicyPostCount());
353         builder.append(", totalTemplateGetCount=");
354         builder.append(getTotalTemplateGetCount());
355         builder.append(", totalTemplatePostCount=");
356         builder.append(getTotalTemplatePostCount());
357         builder.append(", policyGetSuccessCount=");
358         builder.append(getPolicyGetSuccessCount());
359         builder.append(", policyGetFailureCount=");
360         builder.append(getPolicyGetFailureCount());
361         builder.append(", policyPostSuccessCount=");
362         builder.append(getPolicyPostSuccessCount());
363         builder.append(", policyPostFailureCount=");
364         builder.append(getPolicyPostFailureCount());
365         builder.append(", templateGetSuccessCount=");
366         builder.append(getTemplateGetSuccessCount());
367         builder.append(", templateGetFailureCount=");
368         builder.append(getTemplateGetFailureCount());
369         builder.append(", templatePostSuccessCount=");
370         builder.append(getTemplatePostSuccessCount());
371         builder.append(", templatePostFailureCount=");
372         builder.append(getTemplatePostFailureCount());
373         builder.append("]");
374         return builder.toString();
375     }
376 }