Merge "BUG 1839 - HTTP delete of non existing data"
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / ReadyTransactionReply.java
index 32d31bf84db44e87a4ebbbd6328c97c3898fd9ae..eee489177a5d1496b78bd47a8bf873d959082e06 100644 (file)
@@ -8,17 +8,33 @@
 
 package org.opendaylight.controller.cluster.datastore.messages;
 
-import akka.actor.ActorPath;
+import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
 
-public class ReadyTransactionReply {
-  private final ActorPath cohortPath;
+public class ReadyTransactionReply implements SerializableMessage {
+    public static final Class<ShardTransactionMessages.ReadyTransactionReply> SERIALIZABLE_CLASS =
+            ShardTransactionMessages.ReadyTransactionReply.class;
 
-  public ReadyTransactionReply(ActorPath cohortPath) {
+    private final String cohortPath;
 
-    this.cohortPath = cohortPath;
-  }
+    public ReadyTransactionReply(String cohortPath) {
 
-  public ActorPath getCohortPath() {
-    return cohortPath;
-  }
+        this.cohortPath = cohortPath;
+    }
+
+    public String getCohortPath() {
+        return cohortPath;
+    }
+
+    @Override
+    public ShardTransactionMessages.ReadyTransactionReply toSerializable() {
+        return ShardTransactionMessages.ReadyTransactionReply.newBuilder().
+                setActorPath(cohortPath).build();
+    }
+
+    public static ReadyTransactionReply fromSerializable(Object serializable) {
+        ShardTransactionMessages.ReadyTransactionReply o =
+                (ShardTransactionMessages.ReadyTransactionReply) serializable;
+
+        return new ReadyTransactionReply(o.getActorPath());
+    }
 }