package org.opendaylight.controller.cluster.datastore.messages;
-import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
+import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
-public class CommitTransactionReply implements SerializableMessage {
- public static final Class<ThreePhaseCommitCohortMessages.CommitTransactionReply> SERIALIZABLE_CLASS =
- ThreePhaseCommitCohortMessages.CommitTransactionReply.class;
+public class CommitTransactionReply extends VersionedExternalizableMessage {
+ public static final CommitTransactionReply INSTANCE = new CommitTransactionReply();
- private static final Object SERIALIZED_INSTANCE =
- ThreePhaseCommitCohortMessages.CommitTransactionReply.newBuilder().build();
+ public CommitTransactionReply() {
+ }
- public static final CommitTransactionReply INSTANCE = new CommitTransactionReply();
+ private CommitTransactionReply(short version) {
+ super(version);
+ }
+
+ public static CommitTransactionReply instance(short version) {
+ return version == DataStoreVersions.CURRENT_VERSION ? INSTANCE : new CommitTransactionReply(version);
+ }
- @Override
- public Object toSerializable() {
- return SERIALIZED_INSTANCE;
+ public static boolean isSerializedType(Object message) {
+ return message instanceof CommitTransactionReply;
}
}