Add exists method on DOMStoreReadTransaction and DOMDataReadTransaction
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / ShardReadTransaction.java
index 7a18fca100f027b2bfad23b0433eeb91eab06484..1328d466f34b6fff82a91b98379cd815b488155c 100644 (file)
@@ -16,6 +16,7 @@ import akka.event.Logging;
 import akka.event.LoggingAdapter;
 import org.opendaylight.controller.cluster.datastore.messages.CloseTransaction;
 import org.opendaylight.controller.cluster.datastore.messages.CloseTransactionReply;
+import org.opendaylight.controller.cluster.datastore.messages.DataExists;
 import org.opendaylight.controller.cluster.datastore.messages.ReadData;
 import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
 import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain;
@@ -44,7 +45,9 @@ public class ShardReadTransaction extends ShardTransaction {
   @Override
   public void handleReceive(Object message) throws Exception {
     if (ReadData.SERIALIZABLE_CLASS.equals(message.getClass())) {
-      readData(transaction,ReadData.fromSerializable(message));
+        readData(transaction, ReadData.fromSerializable(message));
+    } else if(DataExists.SERIALIZABLE_CLASS.equals(message.getClass())) {
+        dataExists(transaction, DataExists.fromSerializable(message));
     } else {
       super.handleReceive(message);
     }