BUG-5280: implement message queueing
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / ShardReadTransaction.java
index 8ece2593f53f4e191653fa3b93094d6e4cf091cf..ec526d4fc07e01486fa7ed0cac9aa28b54e609c3 100644 (file)
@@ -11,6 +11,7 @@ package org.opendaylight.controller.cluster.datastore;
 import akka.actor.ActorRef;
 import akka.actor.PoisonPill;
 import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
 import org.opendaylight.controller.cluster.datastore.jmx.mbeans.shard.ShardStats;
 import org.opendaylight.controller.cluster.datastore.messages.CreateSnapshot;
 import org.opendaylight.controller.cluster.datastore.messages.DataExists;
@@ -28,20 +29,19 @@ public class ShardReadTransaction extends ShardTransaction {
     private final AbstractShardDataTreeTransaction<?> transaction;
 
     public ShardReadTransaction(AbstractShardDataTreeTransaction<?> transaction, ActorRef shardActor,
-            ShardStats shardStats, String transactionID) {
-        super(shardActor, shardStats, transactionID);
-        this.transaction = transaction;
+            ShardStats shardStats) {
+        super(shardActor, shardStats, transaction.getId());
+        this.transaction = Preconditions.checkNotNull(transaction);
     }
 
     @Override
-    public void handleReceive(Object message) throws Exception {
+    public void handleReceive(Object message) {
         if (message instanceof CreateSnapshot) {
             createSnapshot();
         } else if(ReadData.isSerializedType(message)) {
             readData(transaction, ReadData.fromSerializable(message));
         } else if(DataExists.isSerializedType(message)) {
             dataExists(transaction, DataExists.fromSerializable(message));
-
         } else {
             super.handleReceive(message);
         }