BUG-5280: remove support for talking to pre-Boron clients
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / CommitTransactionReply.java
index afeba298797ea2aead2879ec98d4100bde0996cd..cd3a13a9f7a8d8a4948cc5d0b1d3395c45b4e44b 100644 (file)
@@ -8,14 +8,23 @@
 
 package org.opendaylight.controller.cluster.datastore.messages;
 
-import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
+import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
 
-public class CommitTransactionReply implements SerializableMessage {
+public class CommitTransactionReply extends VersionedExternalizableMessage {
+    public static final CommitTransactionReply INSTANCE = new CommitTransactionReply();
 
-  public static Class SERIALIZABLE_CLASS = ThreePhaseCommitCohortMessages.CommitTransactionReply.class;
+    public CommitTransactionReply() {
+    }
 
-  @Override
-  public Object toSerializable() {
-    return  ThreePhaseCommitCohortMessages.CommitTransactionReply.newBuilder().build();
-  }
+    private CommitTransactionReply(short version) {
+        super(version);
+    }
+
+    public static CommitTransactionReply instance(short version) {
+        return version == DataStoreVersions.CURRENT_VERSION ? INSTANCE : new CommitTransactionReply(version);
+    }
+
+    public static boolean isSerializedType(Object message) {
+        return message instanceof CommitTransactionReply;
+    }
 }