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 0839462..db62547 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,13 +25,6 @@ public class DataExists extends AbstractRead<Boolean> {
         super(path, version);
     }
 
-    @Deprecated
-    @Override
-    protected Object newLegacySerializedInstance() {
-        return ShardTransactionMessages.DataExists.newBuilder()
-                .setInstanceIdentifierPathArguments(InstanceIdentifierUtils.toSerializable(getPath())).build();
-    }
-
     @Override
     public CheckedFuture<Boolean, ReadFailedException> apply(DOMStoreReadTransaction readDelegate) {
         return readDelegate.exists(getPath());
@@ -54,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;
     }
 }