Define DataStoreVersions.MAGNESIUM_VERSION
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / TransactionContext.java
index 765d5bb7eccb1e01ad320fa9b37a48673d9c1e24..d9a53ab29189b47e004623bb5938841a6affa34e 100644 (file)
@@ -9,6 +9,8 @@ package org.opendaylight.controller.cluster.datastore;
 
 import akka.actor.ActorSelection;
 import com.google.common.util.concurrent.SettableFuture;
+import java.util.Optional;
+import java.util.SortedSet;
 import org.opendaylight.controller.cluster.datastore.messages.AbstractRead;
 import org.opendaylight.controller.cluster.datastore.modification.AbstractModification;
 import scala.concurrent.Future;
@@ -20,27 +22,29 @@ import scala.concurrent.Future;
 interface TransactionContext {
     void closeTransaction();
 
-    Future<ActorSelection> readyTransaction();
+    Future<ActorSelection> readyTransaction(Boolean havePermit, Optional<SortedSet<String>> participatingShardNames);
 
-    void executeModification(AbstractModification modification);
+    void executeModification(AbstractModification modification, Boolean havePermit);
 
-    <T> void executeRead(AbstractRead<T> readCmd, SettableFuture<T> promise);
+    <T> void executeRead(AbstractRead<T> readCmd, SettableFuture<T> promise, Boolean havePermit);
 
-    Future<Object> directCommit();
+    Future<Object> directCommit(Boolean havePermit);
 
     /**
      * Invoked by {@link TransactionContextWrapper} when it has finished handing
      * off operations to this context. From this point on, the context is responsible
      * for throttling operations.
      *
+     * <p>
      * Implementations can rely on the wrapper calling this operation in a synchronized
      * block, so they do not need to ensure visibility of this state transition themselves.
      */
     void operationHandOffComplete();
 
     /**
-     * A TransactionContext that uses Operation limiting should return true else false
-     * @return
+     * A TransactionContext that uses operation limiting should return true else false.
+     *
+     * @return true if operation limiting is used, false otherwise
      */
     boolean usesOperationLimiting();