X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fmessages%2FCanCommitTransactionReply.java;h=f346cba4334ffce9b93f1ff53e33b9e0401d94fa;hp=6b88b96ca6ac7f2363647fe8189aa5537bdb2ef7;hb=24c074a4b32ac97980a652b78824b7c2f97ffb78;hpb=c796596b5c46b5203c30b143e6282662e66c5642 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CanCommitTransactionReply.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CanCommitTransactionReply.java index 6b88b96ca6..f346cba433 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CanCommitTransactionReply.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CanCommitTransactionReply.java @@ -8,11 +8,11 @@ package org.opendaylight.controller.cluster.datastore.messages; +import com.google.common.base.Preconditions; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import org.opendaylight.controller.cluster.datastore.DataStoreVersions; -import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages; public class CanCommitTransactionReply extends VersionedExternalizableMessage { private static final CanCommitTransactionReply YES = @@ -20,14 +20,6 @@ public class CanCommitTransactionReply extends VersionedExternalizableMessage { private static final CanCommitTransactionReply NO = new CanCommitTransactionReply(false, DataStoreVersions.CURRENT_VERSION); - @Deprecated - private static final ThreePhaseCommitCohortMessages.CanCommitTransactionReply YES_SERIALIZED = - ThreePhaseCommitCohortMessages.CanCommitTransactionReply.newBuilder().setCanCommit(true).build(); - - @Deprecated - private static final ThreePhaseCommitCohortMessages.CanCommitTransactionReply NO_SERIALIZED = - ThreePhaseCommitCohortMessages.CanCommitTransactionReply.newBuilder().setCanCommit(false).build(); - private boolean canCommit; public CanCommitTransactionReply() { @@ -54,12 +46,6 @@ public class CanCommitTransactionReply extends VersionedExternalizableMessage { out.writeBoolean(canCommit); } - @Deprecated - @Override - protected Object newLegacySerializedInstance() { - return canCommit ? YES_SERIALIZED : NO_SERIALIZED; - } - @Override public String toString() { return "CanCommitTransactionReply [canCommit=" + canCommit + ", version=" + getVersion() + "]"; @@ -74,17 +60,11 @@ public class CanCommitTransactionReply extends VersionedExternalizableMessage { } public static CanCommitTransactionReply fromSerializable(final Object serializable) { - if(serializable instanceof CanCommitTransactionReply) { - return (CanCommitTransactionReply)serializable; - } else { - ThreePhaseCommitCohortMessages.CanCommitTransactionReply serialized = - (ThreePhaseCommitCohortMessages.CanCommitTransactionReply) serializable; - return serialized.getCanCommit() ? YES : NO; - } + Preconditions.checkArgument(serializable instanceof CanCommitTransactionReply); + return (CanCommitTransactionReply)serializable; } public static boolean isSerializedType(Object message) { - return message instanceof CanCommitTransactionReply || - message instanceof ThreePhaseCommitCohortMessages.CanCommitTransactionReply; + return message instanceof CanCommitTransactionReply; } }