2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 * SPDX-License-Identifier: Apache-2.0
20 * ============LICENSE_END=========================================================
23 package org.onap.policy.api.main.rest;
26 * Class to represent API statistics report.
28 public class StatisticsReport {
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;
48 * Returns the code of this {@link StatisticsReport} instance.
52 public int getCode() {
57 * Set code in this {@link StatisticsReport} instance.
59 * @param code the code to set
61 public void setCode(final int code) {
66 * Returns the totalApiCallCount of this {@link StatisticsReport} instance.
68 * @return the totalApiCallCount
70 public long getTotalApiCallCount() {
71 return totalApiCallCount;
75 * Set totalApiCallCount in this {@link StatisticsReport} instance.
77 * @param totalApiCallCount the totalApiCallCount to set
79 public void setTotalApiCallCount(final long totalApiCallCount) {
80 this.totalApiCallCount = totalApiCallCount;
84 * Returns the apiCallSuccessCount of this {@link StatisticsReport} instance.
86 * @return the apiCallSuccessCount
88 public long getApiCallSuccessCount() {
89 return apiCallSuccessCount;
93 * Set apiCallSuccessCount in this {@link StatisticsReport} instance.
95 * @param apiCallSuccessCount the apiCallSuccessCount to set
97 public void setApiCallSuccessCount(final long apiCallSuccessCount) {
98 this.apiCallSuccessCount = apiCallSuccessCount;
102 * Returns the apiCallFailureCount of this {@link StatisticsReport} instance.
104 * @return the apiCallFailureCount
106 public long getApiCallFailureCount() {
107 return apiCallFailureCount;
111 * Set apiCallFailureCount in this {@link StatisticsReport} instance.
113 * @param apiCallFailureCount the apiCallFailureCount to set
115 public void setApiCallFailureCount(final long apiCallFailureCount) {
116 this.apiCallFailureCount = apiCallFailureCount;
120 * Returns the totalPolicyGetCount of this {@link StatisticsReport} instance.
122 * @return the totalPolicyGetCount
124 public long getTotalPolicyGetCount() {
125 return totalPolicyGetCount;
129 * Set totalPolicyGetCount in this {@link StatisticsReport} instance.
131 * @param totalPolicyGetCount the totalPolicyGetCount to set
133 public void setTotalPolicyGetCount(final long totalPolicyGetCount) {
134 this.totalPolicyGetCount = totalPolicyGetCount;
138 * Returns the totalPolicyPostCount of this {@link StatisticsReport} instance.
140 * @return the totalPolicyPostCount
142 public long getTotalPolicyPostCount() {
143 return totalPolicyPostCount;
147 * Set totalPolicyPostCount in this {@link StatisticsReport} instance.
149 * @param totalPolicyPostCount the totalPolicyPostCount to set
151 public void setTotalPolicyPostCount(final long totalPolicyPostCount) {
152 this.totalPolicyPostCount = totalPolicyPostCount;
156 * Returns the totalTemplateGetCount of this {@link StatisticsReport} instance.
158 * @return the totalTemplateGetCount
160 public long getTotalTemplateGetCount() {
161 return totalTemplateGetCount;
165 * Set totalTemplateGetCount in this {@link StatisticsReport} instance.
167 * @param totalTemplateGetCount the totalTemplateGetCount to set
169 public void setTotalTemplateGetCount(final long totalTemplateGetCount) {
170 this.totalTemplateGetCount = totalTemplateGetCount;
174 * Returns the totalTemplatePostCount of this {@link StatisticsReport} instance.
176 * @return the totalTemplatePostCount
178 public long getTotalTemplatePostCount() {
179 return totalTemplatePostCount;
183 * Set totalTemplatePostCount in this {@link StatisticsReport} instance.
185 * @param totalTemplatePostCount the totalTemplatePostCount to set
187 public void setTotalTemplatePostCount(final long totalTemplatePostCount) {
188 this.totalTemplatePostCount = totalTemplatePostCount;
192 * Returns the policyGetSuccessCount of this {@link StatisticsReport} instance.
194 * @return the policyGetSuccessCount
196 public long getPolicyGetSuccessCount() {
197 return policyGetSuccessCount;
201 * Set policyGetSuccessCount in this {@link StatisticsReport} instance.
203 * @param policyGetSuccessCount the policyGetSuccessCount to set
205 public void setPolicyGetSuccessCount(final long policyGetSuccessCount) {
206 this.policyGetSuccessCount = policyGetSuccessCount;
210 * Returns the policyGetFailureCount of this {@link StatisticsReport} instance.
212 * @return the policyGetFailureCount
214 public long getPolicyGetFailureCount() {
215 return policyGetFailureCount;
219 * Set policyGetFailureCount in this {@link StatisticsReport} instance.
221 * @param policyGetFailureCount the policyGetFailureCount to set
223 public void setPolicyGetFailureCount(final long policyGetFailureCount) {
224 this.policyGetFailureCount = policyGetFailureCount;
228 * Returns the policyPostSuccessCount of this {@link StatisticsReport} instance.
230 * @return the policyPostSuccessCount
232 public long getPolicyPostSuccessCount() {
233 return policyPostSuccessCount;
237 * Set policyPostSuccessCount in this {@link StatisticsReport} instance.
239 * @param policyPostSuccessCount the policyPostSuccessCount to set
241 public void setPolicyPostSuccessCount(final long policyPostSuccessCount) {
242 this.policyPostSuccessCount = policyPostSuccessCount;
246 * Returns the policyPostFailureCount of this {@link StatisticsReport} instance.
248 * @return the policyPostFailureCount
250 public long getPolicyPostFailureCount() {
251 return policyPostFailureCount;
255 * Set policyPostFailureCount in this {@link StatisticsReport} instance.
257 * @param policyPostFailureCount the policyPostFailureCount to set
259 public void setPolicyPostFailureCount(final long policyPostFailureCount) {
260 this.policyPostFailureCount = policyPostFailureCount;
264 * Returns the templateGetSuccessCount of this {@link StatisticsReport} instance.
266 * @return the templateGetSuccessCount
268 public long getTemplateGetSuccessCount() {
269 return templateGetSuccessCount;
273 * Set templateGetSuccessCount in this {@link StatisticsReport} instance.
275 * @param templateGetSuccessCount the templateGetSuccessCount to set
277 public void setTemplateGetSuccessCount(final long templateGetSuccessCount) {
278 this.templateGetSuccessCount = templateGetSuccessCount;
282 * Returns the templateGetFailureCount of this {@link StatisticsReport} instance.
284 * @return the templateGetFailureCount
286 public long getTemplateGetFailureCount() {
287 return templateGetFailureCount;
291 * Set templateGetFailureCount in this {@link StatisticsReport} instance.
293 * @param templateGetFailureCount the templateGetFailureCount to set
295 public void setTemplateGetFailureCount(final long templateGetFailureCount) {
296 this.templateGetFailureCount = templateGetFailureCount;
300 * Returns the templatePostSuccessCount of this {@link StatisticsReport} instance.
302 * @return the templatePostSuccessCount
304 public long getTemplatePostSuccessCount() {
305 return templatePostSuccessCount;
309 * Set templatePostSuccessCount in this {@link StatisticsReport} instance.
311 * @param templatePostSuccessCount the templatePostSuccessCount to set
313 public void setTemplatePostSuccessCount(final long templatePostSuccessCount) {
314 this.templatePostSuccessCount = templatePostSuccessCount;
318 * Returns the templatePostFailureCount of this {@link StatisticsReport} instance.
320 * @return the templatePostFailureCount
322 public long getTemplatePostFailureCount() {
323 return templatePostFailureCount;
327 * Set templatePostFailureCount in this {@link StatisticsReport} instance.
329 * @param templatePostFailureCount the templatePostFailureCount to set
331 public void setTemplatePostFailureCount(final long templatePostFailureCount) {
332 this.templatePostFailureCount = templatePostFailureCount;
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());
374 return builder.toString();