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 / CommitTransaction.java
index 52ab643ad838987f32e0158811b177bef635023d..16cab0950b614224b7dd285fc93a5f1ad77e8920 100644 (file)
@@ -8,8 +8,7 @@
 
 package org.opendaylight.controller.cluster.datastore.messages;
 
-import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
-import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
+import com.google.common.base.Preconditions;
 
 public class CommitTransaction extends AbstractThreePhaseCommitMessage {
     private static final long serialVersionUID = 1L;
@@ -21,24 +20,13 @@ public class CommitTransaction extends AbstractThreePhaseCommitMessage {
         super(transactionID, version);
     }
 
-    @Deprecated
-    @Override
-    protected Object newLegacySerializedInstance() {
-        return ThreePhaseCommitCohortMessages.CommitTransaction.newBuilder().setTransactionId(
-                getTransactionID()).build();
-    }
-
     public static CommitTransaction fromSerializable(Object serializable) {
-        if(serializable instanceof CommitTransaction) {
-            return (CommitTransaction)serializable;
-        } else {
-            return new CommitTransaction(((ThreePhaseCommitCohortMessages.CommitTransaction)serializable).
-                    getTransactionId(), DataStoreVersions.LITHIUM_VERSION);
-        }
+        Preconditions.checkArgument(serializable instanceof CommitTransaction);
+        return (CommitTransaction)serializable;
+
     }
 
     public static boolean isSerializedType(Object message) {
-        return message instanceof CommitTransaction ||
-                message instanceof ThreePhaseCommitCohortMessages.CommitTransaction;
+        return message instanceof CommitTransaction;
     }
 }