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 / ReadData.java
index 6a01f28..a9d1311 100644 (file)
@@ -9,12 +9,10 @@
 package org.opendaylight.controller.cluster.datastore.messages;
 
 import com.google.common.base.Optional;
+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;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
@@ -29,13 +27,6 @@ public class ReadData extends AbstractRead<Optional<NormalizedNode<?, ?>>> {
         super(path, version);
     }
 
-    @Deprecated
-    @Override
-    protected Object newLegacySerializedInstance() {
-        return ShardTransactionMessages.ReadData.newBuilder()
-                .setInstanceIdentifierPathArguments(InstanceIdentifierUtils.toSerializable(getPath())).build();
-    }
-
     @Override
     public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> apply(DOMStoreReadTransaction readDelegate) {
         return readDelegate.read(getPath());
@@ -57,16 +48,11 @@ public class ReadData extends AbstractRead<Optional<NormalizedNode<?, ?>>> {
     }
 
     public static ReadData fromSerializable(final Object serializable) {
-        if(serializable instanceof ReadData) {
-            return (ReadData)serializable;
-        } else {
-            ShardTransactionMessages.ReadData o = (ShardTransactionMessages.ReadData)serializable;
-            return new ReadData(InstanceIdentifierUtils.fromSerializable(o.getInstanceIdentifierPathArguments()),
-                    DataStoreVersions.LITHIUM_VERSION);
-        }
+        Preconditions.checkArgument(serializable instanceof ReadData);
+        return (ReadData)serializable;
     }
 
     public static boolean isSerializedType(Object message) {
-        return message instanceof ReadData || message instanceof ShardTransactionMessages.ReadData;
+        return message instanceof ReadData;
     }
 }