Add statistics and sonar cleanup and blacklist
[policy/xacml-pdp.git] / main / src / main / java / org / onap / policy / pdpx / main / rest / XacmlPdpStatisticsManager.java
index cfdfa3d..d209c09 100644 (file)
@@ -28,6 +28,7 @@ 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;
@@ -58,6 +59,15 @@ public class XacmlPdpStatisticsManager {
         return ++totalPoliciesCount;
     }
 
+    /**
+     * Method to update the number of error decisions.
+     *
+     * @return the errorDecisionsCount
+     */
+    public static long updateErrorCount() {
+        return ++errorsCount;
+    }
+
     /**
      * Method to update the number of permit decisions.
      *
@@ -112,6 +122,15 @@ public class XacmlPdpStatisticsManager {
         return totalPoliciesCount;
     }
 
+    /**
+     * Returns the current value of errorDecisionsCount.
+
+     * @return the permitDecisionsCount
+     */
+    public static long getErrorCount() {
+        return errorsCount;
+    }
+
     /**
      * Returns the current value of permitDecisionsCount.
 
@@ -152,7 +171,9 @@ public class XacmlPdpStatisticsManager {
      * Reset all the statistics counts to 0.
      */
     public static void resetAllStatistics() {
+        totalPolicyTypesCount = 0L;
         totalPoliciesCount = 0L;
+        errorsCount = 0L;
         permitDecisionsCount = 0L;
         denyDecisionsCount = 0L;
         indeterminantDecisionsCount = 0L;