Remove TransactionContext.supportsDirectCommit method
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / TransactionContext.java
index 1b8e65e02d6d1bad037a02beaa77310088b6e67d..765d5bb7eccb1e01ad320fa9b37a48673d9c1e24 100644 (file)
@@ -8,11 +8,9 @@
 package org.opendaylight.controller.cluster.datastore;
 
 import akka.actor.ActorSelection;
-import com.google.common.base.Optional;
 import com.google.common.util.concurrent.SettableFuture;
-import java.util.List;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.controller.cluster.datastore.messages.AbstractRead;
+import org.opendaylight.controller.cluster.datastore.modification.AbstractModification;
 import scala.concurrent.Future;
 
 /*
@@ -24,15 +22,27 @@ interface TransactionContext {
 
     Future<ActorSelection> readyTransaction();
 
-    void writeData(YangInstanceIdentifier path, NormalizedNode<?, ?> data);
+    void executeModification(AbstractModification modification);
 
-    void deleteData(YangInstanceIdentifier path);
+    <T> void executeRead(AbstractRead<T> readCmd, SettableFuture<T> promise);
 
-    void mergeData(YangInstanceIdentifier path, NormalizedNode<?, ?> data);
+    Future<Object> directCommit();
 
-    void readData(final YangInstanceIdentifier path, SettableFuture<Optional<NormalizedNode<?, ?>>> proxyFuture);
+    /**
+     * 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.
+     *
+     * 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();
 
-    void dataExists(YangInstanceIdentifier path, SettableFuture<Boolean> proxyFuture);
+    /**
+     * A TransactionContext that uses Operation limiting should return true else false
+     * @return
+     */
+    boolean usesOperationLimiting();
 
-    List<Future<Object>> getRecordedOperationFutures();
+    short getTransactionVersion();
 }