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 class CommitTransactionReply extends VersionedExternalizableMessage {
+ public static final CommitTransactionReply INSTANCE = new CommitTransactionReply();
- public static final Class SERIALIZABLE_CLASS = ThreePhaseCommitCohortMessages.CommitTransactionReply.class;
+ public CommitTransactionReply() {
+ }
- @Override
- public Object toSerializable() {
- return ThreePhaseCommitCohortMessages.CommitTransactionReply.newBuilder().build();
- }
+ private CommitTransactionReply(short version) {
+ super(version);
+ }
+
+ public static CommitTransactionReply instance(short version) {
+ return version == DataStoreVersions.CURRENT_VERSION ? INSTANCE : new CommitTransactionReply(version);
+ }
+
+ public static boolean isSerializedType(Object message) {
+ return message instanceof CommitTransactionReply;
+ }
}