Fetch and Delete policy API with PolicyName and PolicyVersion
[policy/api.git] / main / src / main / java / org / onap / policy / api / main / rest / ApiStatisticsManager.java
index 6f8fb10..c40a38c 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP Policy API
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2020 Bell Canada.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -46,12 +47,18 @@ public class ApiStatisticsManager {
     @Getter
     private static long totalPolicyPostCount;
 
+    @Getter
+    private static long totalPolicyDeleteCount;
+
     @Getter
     private static long totalPolicyTypeGetCount;
 
     @Getter
     private static long totalPolicyTypePostCount;
 
+    @Getter
+    private static long totalPolicyTypeDeleteCount;
+
     @Getter
     private static long policyGetSuccessCount;
 
@@ -64,6 +71,12 @@ public class ApiStatisticsManager {
     @Getter
     private static long policyPostFailureCount;
 
+    @Getter
+    private static long policyDeleteSuccessCount;
+
+    @Getter
+    private static long policyDeleteFailureCount;
+
     @Getter
     private static long policyTypeGetSuccessCount;
 
@@ -76,6 +89,12 @@ public class ApiStatisticsManager {
     @Getter
     private static long policyTypePostFailureCount;
 
+    @Getter
+    private static long policyTypeDeleteSuccessCount;
+
+    @Getter
+    private static long policyTypeDeleteFailureCount;
+
     private ApiStatisticsManager() {
         throw new IllegalStateException("Instantiation of the class is not allowed");
     }
@@ -125,6 +144,15 @@ public class ApiStatisticsManager {
         return ++totalPolicyPostCount;
     }
 
+    /**
+     * Method to update the total policy DELETE count.
+     *
+     * @return the updated value of  totalPolicyDeleteCount
+     */
+    public static long updateTotalPolicyDeleteCount() {
+        return ++totalPolicyDeleteCount;
+    }
+
     /**
      * Method to update the total policyType GET count.
      *
@@ -143,6 +171,15 @@ public class ApiStatisticsManager {
         return ++totalPolicyTypePostCount;
     }
 
+    /**
+     * Method to update the total policyType DELETE count.
+     *
+     * @return the updated value of totalPolicyTypeDeleteCount
+     */
+    public static long updateTotalPolicyTypeDeleteCount() {
+        return ++totalPolicyTypeDeleteCount;
+    }
+
     /**
      * Method to update successful policy GET count.
      *
@@ -179,6 +216,24 @@ public class ApiStatisticsManager {
         return ++policyPostFailureCount;
     }
 
+    /**
+     * Method to update successful policy DELETE count.
+     *
+     * @return the updated value of policyDeleteSuccessCount
+     */
+    public static long updatePolicyDeleteSuccessCount() {
+        return ++policyDeleteSuccessCount;
+    }
+
+    /**
+     * Method to update failed policy DELETE count.
+     *
+     * @return the updated value of policyDeleteFailureCount
+     */
+    public static long updatePolicyDeleteFailureCount() {
+        return ++policyDeleteFailureCount;
+    }
+
     /**
      * Method to update successful policyType GET count.
      *
@@ -215,6 +270,24 @@ public class ApiStatisticsManager {
         return ++policyTypePostFailureCount;
     }
 
+    /**
+     * Method to update successful policyType DELETE count.
+     *
+     * @return the updated value of policyTypeDeleteSuccessCount
+     */
+    public static long updatePolicyTypeDeleteSuccessCount() {
+        return ++policyTypeDeleteSuccessCount;
+    }
+
+    /**
+     * Method to update failed policyType DELETE count.
+     *
+     * @return the updated value of policyTypePostFailureCount
+     */
+    public static long updatePolicyTypeDeleteFailureCount() {
+        return ++policyTypeDeleteFailureCount;
+    }
+
     /**
      * Reset all the statistics counts to 0.
      */
@@ -224,15 +297,23 @@ public class ApiStatisticsManager {
         apiCallFailureCount = 0L;
         totalPolicyGetCount = 0L;
         totalPolicyPostCount = 0L;
+        totalPolicyDeleteCount = 0L;
         totalPolicyTypeGetCount = 0L;
         totalPolicyTypePostCount = 0L;
+        totalPolicyTypeDeleteCount = 0L;
         policyGetSuccessCount = 0L;
         policyGetFailureCount = 0L;
         policyPostSuccessCount = 0L;
         policyPostFailureCount = 0L;
+        policyDeleteSuccessCount = 0L;
+        policyDeleteFailureCount = 0L;
         policyTypeGetSuccessCount = 0L;
         policyTypeGetFailureCount = 0L;
         policyTypePostSuccessCount = 0L;
         policyTypePostFailureCount = 0L;
+        policyTypeDeleteSuccessCount = 0L;
+        policyTypeDeleteFailureCount = 0L;
+
     }
+
 }