Package and Create Docker Image for Xacml PDP
[policy/xacml-pdp.git] / main / src / main / java / org / onap / policy / pdpx / main / rest / StatisticsReport.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.pdpx.main.rest;
22
23 /**
24  * Class to represent statistics report of xacmlPdp service.
25  *
26  */
27 public class StatisticsReport {
28
29     private int code;
30     private long totalPoliciesCount;
31     private long permitDecisionsCount;
32     private long denyDecisionsCount;
33     private long indeterminantDecisionsCount;
34     private long notApplicableDecisionsCount;
35
36
37     /**
38      * Returns the code of this {@link StatisticsReport} instance.
39      *
40      * @return the code
41      */
42     public int getCode() {
43         return code;
44     }
45
46     /**
47      * Set code in this {@link StatisticsReport} instance.
48      *
49      * @param code the code to set
50      */
51     public void setCode(final int code) {
52         this.code = code;
53     }
54
55     /**
56      * Returns the totalPoliciesCount of this {@link StatisticsReport} instance.
57      *
58      * @return the totalPoliciesCount
59      */
60     public long getTotalPoliciesCount() {
61         return totalPoliciesCount;
62     }
63
64     /**
65      * Set totalPoliciesCount in this {@link StatisticsReport} instance.
66      *
67      * @param totalPoliciesCount the totalPoliciesCount to set
68      */
69     public void setTotalPoliciesCount(long totalPoliciesCount) {
70         this.totalPoliciesCount = totalPoliciesCount;
71     }
72
73     /**
74      * Returns the permitDecisionsCount of this {@link StatisticsReport} instance.
75      *
76      * @return the permitDecisionsCount
77      */
78     public long getPermitDecisionsCount() {
79         return permitDecisionsCount;
80     }
81
82     /**
83      * Set permitDecisionsCount in this {@link StatisticsReport} instance.
84      *
85      * @param permitDecisionsCount the permitDecisionsCount to set
86      */
87     public void setPermitDecisionsCount(long permitDecisionsCount) {
88         this.permitDecisionsCount = permitDecisionsCount;
89     }
90
91     /**
92      * Returns the denyDecisionsCount of this {@link StatisticsReport} instance.
93      *
94      * @return the denyDecisionsCount
95      */
96     public long getDenyDecisionsCount() {
97         return denyDecisionsCount;
98     }
99
100     /**
101      * Set denyDecisionsCount in this {@link StatisticsReport} instance.
102      *
103      * @param denyDecisionsCount the denyDecisionsCount to set
104      */
105     public void setDenyDecisionsCount(long denyDecisionsCount) {
106         this.denyDecisionsCount = denyDecisionsCount;
107     }
108
109     /**
110      * Returns the indeterminantDecisionsCount of this {@link StatisticsReport} instance.
111      *
112      * @return the indeterminantDecisionsCount
113      */
114     public long getIndeterminantDecisionsCount() {
115         return indeterminantDecisionsCount;
116     }
117
118     /**
119      * Set indeterminantDecisionsCount in this {@link StatisticsReport} instance.
120      *
121      * @param indeterminantDecisionsCount the indeterminantDecisionsCount to set
122      */
123     public void setIndeterminantDecisionsCount(long indeterminantDecisionsCount) {
124         this.indeterminantDecisionsCount = indeterminantDecisionsCount;
125     }
126
127     /**
128      * Returns the notApplicableDecisionsCount of this {@link StatisticsReport} instance.
129      *
130      * @return the notApplicableDecisionsCount
131      */
132     public long getNotApplicableDecisionsCount() {
133         return notApplicableDecisionsCount;
134     }
135
136     /**
137      * Set notApplicableDecisionsCount in this {@link StatisticsReport} instance.
138      *
139      * @param notApplicableDecisionsCount the notApplicableDecisionsCount to set
140      */
141     public void setNotApplicableDecisionsCount(long notApplicableDecisionsCount) {
142         this.notApplicableDecisionsCount = notApplicableDecisionsCount;
143     }
144
145     /**
146      * {@inheritDoc}.
147      */
148     @Override
149     public String toString() {
150         final StringBuilder builder = new StringBuilder();
151         builder.append("StatisticsReport [code=");
152         builder.append(getCode());
153         builder.append(", totalPoliciesCount=");
154         builder.append(getTotalPoliciesCount());
155         builder.append(", permitDecisionsCount=");
156         builder.append(getPermitDecisionsCount());
157         builder.append(", denyDecisionsCount=");
158         builder.append(getDenyDecisionsCount());
159         builder.append(", indeterminantDecisionsCount=");
160         builder.append(getIndeterminantDecisionsCount());
161         builder.append(", notApplicableDecisionsCount=");
162         builder.append(getNotApplicableDecisionsCount());
163         builder.append("]");
164         return builder.toString();
165     }
166 }