Use a static YangInstanceIdentifier in AbstractEntityOwnerChangeListener
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / ShardReadWriteTransaction.java
index c90b2ae02855145282b3a6ea72deb92364c06927..515b448f7b1ebf7f3f4981487c14f980a8eb4268 100644 (file)
@@ -1,11 +1,9 @@
 /*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
  *
- *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- *  This program and the accompanying materials are made available under the
- *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
- *  and is available at http://www.eclipse.org/legal/epl-v10.html
- *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
 package org.opendaylight.controller.cluster.datastore;
@@ -21,23 +19,16 @@ import org.opendaylight.controller.cluster.datastore.messages.ReadData;
  */
 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, String transactionID) {
+        super(transaction, shardActor, shardStats, transactionID);
     }
 
     @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);
+        if(ReadData.isSerializedType(message)) {
+            readData(ReadData.fromSerializable(message));
+        } else if(DataExists.isSerializedType(message)) {
+            dataExists((DataExists) message);
         } else {
             super.handleReceive(message);
         }