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 / DataExists.java
index 7d1bcdb8f65c3273e50685eaa58c76cdc6d67d9b..db62547d424506efb26236610e9d1567e032e6fd 100644 (file)
@@ -8,12 +8,10 @@
 
 package org.opendaylight.controller.cluster.datastore.messages;
 
+import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.SettableFuture;
-import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
-import org.opendaylight.controller.cluster.datastore.util.InstanceIdentifierUtils;
 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
 import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
@@ -27,16 +25,6 @@ public class DataExists extends AbstractRead<Boolean> {
         super(path, version);
     }
 
-    @Override
-    public Object toSerializable() {
-        if(getVersion() >= DataStoreVersions.BORON_VERSION) {
-            return this;
-        } else {
-            return ShardTransactionMessages.DataExists.newBuilder().setInstanceIdentifierPathArguments(
-                        InstanceIdentifierUtils.toSerializable(getPath())).build();
-        }
-    }
-
     @Override
     public CheckedFuture<Boolean, ReadFailedException> apply(DOMStoreReadTransaction readDelegate) {
         return readDelegate.exists(getPath());
@@ -57,16 +45,11 @@ public class DataExists extends AbstractRead<Boolean> {
     }
 
     public static DataExists fromSerializable(final Object serializable){
-        if(serializable instanceof DataExists) {
-            return (DataExists)serializable;
-        } else {
-            ShardTransactionMessages.DataExists o = (ShardTransactionMessages.DataExists) serializable;
-            return new DataExists(InstanceIdentifierUtils.fromSerializable(o.getInstanceIdentifierPathArguments()),
-                    DataStoreVersions.LITHIUM_VERSION);
-        }
+        Preconditions.checkArgument(serializable instanceof DataExists);
+        return (DataExists)serializable;
     }
 
     public static boolean isSerializedType(Object message) {
-        return message instanceof DataExists || message instanceof ShardTransactionMessages.DataExists;
+        return message instanceof DataExists;
     }
 }