Improve segmented journal actor metrics
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / ReadyTransactionReply.java
index 32d31bf84db44e87a4ebbbd6328c97c3898fd9ae..a341c72333e3ca92c123ef749bd9a9ab9f6226d5 100644 (file)
@@ -8,17 +8,50 @@
 
 package org.opendaylight.controller.cluster.datastore.messages;
 
-import akka.actor.ActorPath;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
 
-public class ReadyTransactionReply {
-  private final ActorPath cohortPath;
+@Deprecated(since = "9.0.0", forRemoval = true)
+public class ReadyTransactionReply extends VersionedExternalizableMessage {
+    private static final long serialVersionUID = 1L;
 
-  public ReadyTransactionReply(ActorPath cohortPath) {
+    private String cohortPath;
 
-    this.cohortPath = cohortPath;
-  }
+    public ReadyTransactionReply() {
+    }
 
-  public ActorPath getCohortPath() {
-    return cohortPath;
-  }
+    public ReadyTransactionReply(final String cohortPath) {
+        this(cohortPath, DataStoreVersions.CURRENT_VERSION);
+    }
+
+    public ReadyTransactionReply(final String cohortPath, final short version) {
+        super(version);
+        this.cohortPath = cohortPath;
+    }
+
+    public String getCohortPath() {
+        return cohortPath;
+    }
+
+    @Override
+    public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
+        super.readExternal(in);
+        cohortPath = in.readUTF();
+    }
+
+    @Override
+    public void writeExternal(final ObjectOutput out) throws IOException {
+        super.writeExternal(out);
+        out.writeUTF(cohortPath);
+    }
+
+    public static ReadyTransactionReply fromSerializable(final Object serializable) {
+        return (ReadyTransactionReply)serializable;
+    }
+
+    public static boolean isSerializedType(final Object message) {
+        return message instanceof ReadyTransactionReply;
+    }
 }