Serialization/Deserialization and a host of other fixes
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / ReadData.java
index cb6347f3e54909330ea924956029f895f44f69e1..a698f4634797116875871d20bf5d68d90ffb1ff7 100644 (file)
@@ -10,28 +10,28 @@ package org.opendaylight.controller.cluster.datastore.messages;
 
 import org.opendaylight.controller.cluster.datastore.utils.InstanceIdentifierUtils;
 import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
 public class ReadData {
   public static final Class SERIALIZABLE_CLASS = ShardTransactionMessages.ReadData.class;
-  private final InstanceIdentifier path;
+  private final YangInstanceIdentifier path;
 
-  public ReadData(InstanceIdentifier path) {
+  public ReadData(YangInstanceIdentifier path) {
     this.path = path;
   }
 
-  public InstanceIdentifier getPath() {
+  public YangInstanceIdentifier getPath() {
     return path;
   }
 
   public Object toSerializable(){
     return ShardTransactionMessages.ReadData.newBuilder()
-        .setInstanceIdentifierPathArguments(path.toString())
+        .setInstanceIdentifierPathArguments(InstanceIdentifierUtils.toSerializable(path))
         .build();
   }
 
   public static ReadData fromSerializable(Object serializable){
     ShardTransactionMessages.ReadData o = (ShardTransactionMessages.ReadData) serializable;
-    return new ReadData(InstanceIdentifierUtils.from(o.getInstanceIdentifierPathArguments()));
+    return new ReadData(InstanceIdentifierUtils.fromSerializable(o.getInstanceIdentifierPathArguments()));
   }
 }