package org.onap.policy.pdpx.main.rest;
+import lombok.Getter;
+import lombok.Setter;
+
/**
* Class to hold statistical data for xacmlPdp component.
*
*/
public class XacmlPdpStatisticsManager {
-
- private static long totalPolicyTypesCount;
- private static long totalPoliciesCount;
- private static long errorsCount;
- private static long permitDecisionsCount;
- private static long denyDecisionsCount;
- private static long indeterminantDecisionsCount;
- private static long notApplicableDecisionsCount;
-
- private XacmlPdpStatisticsManager() {
- throw new IllegalStateException("Instantiation of the class is not allowed");
- }
+ @Getter
+ @Setter
+ private static XacmlPdpStatisticsManager current = null;
+
+ private long totalPolicyTypesCount;
+ private long totalPoliciesCount;
+ private long errorsCount;
+ private long permitDecisionsCount;
+ private long denyDecisionsCount;
+ private long indeterminantDecisionsCount;
+ private long notApplicableDecisionsCount;
/**
* Method to set the xacml pdp total policy types count. This
*
* @return the total
*/
- public static long setTotalPolicyTypesCount(long newCount) {
+ public long setTotalPolicyTypesCount(long newCount) {
totalPolicyTypesCount = newCount;
return totalPolicyTypesCount;
}
*
* @return the total
*/
- public static long updateTotalPoliciesCount() {
+ public long updateTotalPoliciesCount() {
return ++totalPoliciesCount;
}
*
* @return the errorDecisionsCount
*/
- public static long updateErrorCount() {
+ public long updateErrorCount() {
return ++errorsCount;
}
*
* @return the permitDecisionsCount
*/
- public static long updatePermitDecisionsCount() {
+ public long updatePermitDecisionsCount() {
return ++permitDecisionsCount;
}
*
* @return the denyDecisionsCount
*/
- public static long updateDenyDecisionsCount() {
+ public long updateDenyDecisionsCount() {
return ++denyDecisionsCount;
}
*
* @return the indeterminantDecisionsCount
*/
- public static long updateIndeterminantDecisionsCount() {
+ public long updateIndeterminantDecisionsCount() {
return ++indeterminantDecisionsCount;
}
*
* @return the notApplicableDecisionsCount
*/
- public static long updateNotApplicableDecisionsCount() {
+ public long updateNotApplicableDecisionsCount() {
return ++notApplicableDecisionsCount;
}
* @return the totalPolicyTypesCount
*/
- public static long getTotalPolicyTypesCount() {
+ public long getTotalPolicyTypesCount() {
return totalPolicyTypesCount;
}
* @return the totalPoliciesCount
*/
- public static long getTotalPoliciesCount() {
+ public long getTotalPoliciesCount() {
return totalPoliciesCount;
}
* @return the permitDecisionsCount
*/
- public static long getErrorCount() {
+ public long getErrorCount() {
return errorsCount;
}
* @return the permitDecisionsCount
*/
- public static long getPermitDecisionsCount() {
+ public long getPermitDecisionsCount() {
return permitDecisionsCount;
}
* @return the denyDecisionsCount
*/
- public static long getDenyDecisionsCount() {
+ public long getDenyDecisionsCount() {
return denyDecisionsCount;
}
* @return the indeterminantDecisionsCount
*/
- public static long getIndeterminantDecisionsCount() {
+ public long getIndeterminantDecisionsCount() {
return indeterminantDecisionsCount;
}
* @return the notApplicableDecisionsCount
*/
- public static long getNotApplicableDecisionsCount() {
+ public long getNotApplicableDecisionsCount() {
return notApplicableDecisionsCount;
}
/**
* Reset all the statistics counts to 0.
*/
- public static void resetAllStatistics() {
+ public void resetAllStatistics() {
totalPolicyTypesCount = 0L;
totalPoliciesCount = 0L;
errorsCount = 0L;