Monitoring policy creation foundation
[policy/xacml-pdp.git] / main / src / main / java / org / onap / policy / pdpx / main / rest / XacmlPdpStatisticsManager.java
index 471ffca..cfdfa3d 100644 (file)
@@ -26,6 +26,7 @@ package org.onap.policy.pdpx.main.rest;
  */
 public class XacmlPdpStatisticsManager {
 
+    private static long totalPolicyTypesCount;
     private static long totalPoliciesCount;
     private static long permitDecisionsCount;
     private static long denyDecisionsCount;
@@ -36,6 +37,18 @@ public class XacmlPdpStatisticsManager {
         throw new IllegalStateException("Instantiation of the class is not allowed");
     }
 
+    /**
+     * Method to set the xacml pdp total policy types count. This
+     * doesn't really increment, it depends on the applications
+     * that are loaded. Which can be dynamic.
+     *
+     * @return the total
+     */
+    public static long setTotalPolicyTypesCount(long newCount) {
+        totalPolicyTypesCount = newCount;
+        return totalPolicyTypesCount;
+    }
+
     /**
      * Method to update the xacml pdp total policies count.
      *
@@ -81,6 +94,15 @@ public class XacmlPdpStatisticsManager {
         return ++notApplicableDecisionsCount;
     }
 
+    /**
+     * Returns the current value of totalPolicyTypesCount.
+
+     * @return the totalPolicyTypesCount
+     */
+    public static long getTotalPolicyTypesCount() {
+        return totalPolicyTypesCount;
+    }
+
     /**
      * Returns the current value of totalPoliciesCount.