Support for retries in AtomicCounter. Enabled counter operation retries in ConsistentApplicationIdStore

Change-Id: I705c51b2efd7ecd928c64c7f8a16d1965198253c
diff --git a/core/api/src/main/java/org/onosproject/store/service/AtomicCounterBuilder.java b/core/api/src/main/java/org/onosproject/store/service/AtomicCounterBuilder.java
index 8819977..1f5400a 100644
--- a/core/api/src/main/java/org/onosproject/store/service/AtomicCounterBuilder.java
+++ b/core/api/src/main/java/org/onosproject/store/service/AtomicCounterBuilder.java
@@ -1,5 +1,7 @@
 package org.onosproject.store.service;
 
+import java.util.concurrent.ScheduledExecutorService;
+
 /**
  * Builder for AtomicCounter.
  */
@@ -33,6 +35,24 @@
     AtomicCounterBuilder withPartitionsDisabled();
 
     /**
+     * Enables retries when counter operations fail.
+     * <p>
+     * Note: Use with caution. By default retries are disabled.
+     * </p>
+     * @return this AtomicCounterBuilder
+     */
+    AtomicCounterBuilder withRetryOnFailure();
+
+    /**
+     * Sets the executor service to use for retrying failed operations.
+     * <p>
+     * Note: Must be set when retries are enabled
+     * </p>
+     * @return this AtomicCounterBuilder
+     */
+    AtomicCounterBuilder withRetryExecutor(ScheduledExecutorService executor);
+
+    /**
      * Builds a AtomicCounter based on the configuration options
      * supplied to this builder.
      *