BUG 2138 - Do not fail on module-based default shard
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / ShardReadWriteTransaction.java
index 0c358e0b4b3bd120871832a0cdf680cce5b1721f..2978fc8d07e9e00304cff648e9d321dda068815e 100644 (file)
@@ -14,28 +14,22 @@ import org.opendaylight.controller.cluster.datastore.messages.DataExists;
 import org.opendaylight.controller.cluster.datastore.messages.ReadData;
 
 /**
+ * Actor for a shard read/write transaction.
+ *
  * @author: syedbahm
- * Date: 8/6/14
  */
 public class ShardReadWriteTransaction extends ShardWriteTransaction {
     public ShardReadWriteTransaction(ReadWriteShardDataTreeTransaction transaction, ActorRef shardActor,
-            ShardStats shardStats, String transactionID, short clientTxVersion) {
-        super(transaction, shardActor, shardStats, transactionID, clientTxVersion);
+            ShardStats shardStats) {
+        super(transaction, shardActor, shardStats);
     }
 
     @Override
-    public void handleReceive(Object message) throws Exception {
-        if (message instanceof ReadData) {
-            readData((ReadData) message, !SERIALIZED_REPLY);
-
-        } else if (message instanceof DataExists) {
-            dataExists((DataExists) message, !SERIALIZED_REPLY);
-
-        } else if(ReadData.SERIALIZABLE_CLASS.equals(message.getClass())) {
-            readData(ReadData.fromSerializable(message), SERIALIZED_REPLY);
-
-        } else if(DataExists.SERIALIZABLE_CLASS.equals(message.getClass())) {
-            dataExists(DataExists.fromSerializable(message), SERIALIZED_REPLY);
+    public void handleReceive(Object message) {
+        if (ReadData.isSerializedType(message)) {
+            readData(ReadData.fromSerializable(message));
+        } else if (DataExists.isSerializedType(message)) {
+            dataExists((DataExists) message);
         } else {
             super.handleReceive(message);
         }