Move Tx ready call from ShardWriteTransaction to Shard
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / ForwardedReadyTransaction.java
index 719f66c018c04c9e6f54c57dd46b4e923e7a9c91..b3d7f2c2d6dea96c5fd507c573ab723983227b1c 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.controller.cluster.datastore.messages;
 
-import org.opendaylight.controller.cluster.datastore.ShardDataTreeCohort;
+import com.google.common.base.Preconditions;
+import org.opendaylight.controller.cluster.datastore.ReadWriteShardDataTreeTransaction;
 
 /**
  * Transaction ReadyTransaction message that is forwarded to the local Shard from the ShardTransaction.
@@ -16,16 +17,16 @@ import org.opendaylight.controller.cluster.datastore.ShardDataTreeCohort;
  */
 public class ForwardedReadyTransaction {
     private final String transactionID;
-    private final ShardDataTreeCohort cohort;
+    private final ReadWriteShardDataTreeTransaction transaction;
     private final boolean returnSerialized;
     private final boolean doImmediateCommit;
     private final short txnClientVersion;
 
     public ForwardedReadyTransaction(String transactionID, short txnClientVersion,
-            ShardDataTreeCohort cohort, boolean returnSerialized,
+            ReadWriteShardDataTreeTransaction transaction, boolean returnSerialized,
             boolean doImmediateCommit) {
         this.transactionID = transactionID;
-        this.cohort = cohort;
+        this.transaction = Preconditions.checkNotNull(transaction);
         this.returnSerialized = returnSerialized;
         this.txnClientVersion = txnClientVersion;
         this.doImmediateCommit = doImmediateCommit;
@@ -35,8 +36,8 @@ public class ForwardedReadyTransaction {
         return transactionID;
     }
 
-    public ShardDataTreeCohort getCohort() {
-        return cohort;
+    public ReadWriteShardDataTreeTransaction getTransaction() {
+        return transaction;
     }
 
     public boolean isReturnSerialized() {