ovsdb enable checkstyle on error
[ovsdb.git] / southbound / southbound-impl / src / main / java / org / opendaylight / ovsdb / southbound / reconciliation / ReconciliationTaskManager.java
index 2a3e9c35e5d3d32d4dd926358ce150a89f57d801..d0cb4b76c4309d24fbf37a8d7ba668c3553115da 100644 (file)
@@ -7,11 +7,10 @@
  */
 package org.opendaylight.ovsdb.southbound.reconciliation;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.Future;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * This class is a task cache manager that provides a cache to store
@@ -19,14 +18,14 @@ import java.util.concurrent.Future;
  * is submitted to the reconciliation manager, it will be cached in
  * the cache. If the reconciliation is successful or it's done with
  * all the attempt of reconciliation,
- *
+ * <p>
  * Caching of the task is required, because reconciliation task might
  * require longer duration to reconcile and there is a possibility that
  * meanwhile user can change the configuration in config data store while
  * task is queued for the reconciliation. In that scenario, reconciliation
  * manager should not attempt any further reconciliation attempt for that
  * task. ReconciliationManager will call cancelTask() to cancel the task.
- *
+ * </p>
  * Created by Anil Vishnoi (avishnoi@Brocade.com) on 3/15/16.
  */
 class ReconciliationTaskManager {
@@ -38,17 +37,19 @@ class ReconciliationTaskManager {
     public boolean isTaskQueued(ReconciliationTask task) {
         return reconciliationTaskCache.containsKey(task);
     }
+
     public boolean cancelTask(ReconciliationTask task) {
-        if(reconciliationTaskCache.containsKey(task)){
+        if (reconciliationTaskCache.containsKey(task)) {
             Future<?> taskFuture = reconciliationTaskCache.remove(task);
-            if( !taskFuture.isDone() && !taskFuture.isCancelled() ) {
-                LOG.info("Reconciliation task is cancelled : {}",task);
+            if (!taskFuture.isDone() && !taskFuture.isCancelled()) {
+                LOG.info("Reconciliation task is cancelled : {}", task);
                 return taskFuture.cancel(true);
             }
         }
         return false;
 
     }
+
     public void cacheTask(ReconciliationTask task, Future<?> taskFuture) {
         reconciliationTaskCache.put(task,taskFuture);
     }