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