Deprecate 3PC protobuff messages 85/33385/5
authorTom Pantelis <tpanteli@brocade.com>
Fri, 22 Jan 2016 11:34:19 +0000 (06:34 -0500)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 1 Feb 2016 10:43:48 +0000 (10:43 +0000)
Deprecated the associated protobuff messages for

  CanCommitTransaction[Reply]
  CommitTransaction[Reply]
  AbortCommitTransaction[Reply]

The message classes now extend VersionedExternalizableMessage. Related
code was modified accordingly.

The PreCommitTransaction message is no longer used so it was removed.

Backwards compatibility with pre-boron will be implemented in the next
patch as ThreePhaseCommitCohortProxy needs some refactoring so the
appropriate cohort version can be used for the messages.

Change-Id: I8164ec82c7ef1623d38b1599af2f1c73fadb5300
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
28 files changed:
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/protobuff/messages/cohort3pc/ThreePhaseCommitCohortMessages.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/LocalThreePhaseCommitCohort.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardCommitCoordinator.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipShardCommitCoordinator.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/AbortTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/AbortTransactionReply.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/AbstractThreePhaseCommitMessage.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CanCommitTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CanCommitTransactionReply.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CommitTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CommitTransactionReply.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/EmptyReply.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/PreCommitTransaction.java [deleted file]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/PreCommitTransactionReply.java [deleted file]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractTransactionProxyTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreRemotingIntegrationTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ThreePhaseCommitCohortProxyTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipShardTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/AbortTransactionReplyTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/AbortTransactionTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/CanCommitTransactionReplyTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/CanCommitTransactionTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/CommitTransactionReplyTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/CommitTransactionTest.java [new file with mode: 0644]

index 2a79a5b..2f6726a 100644 (file)
@@ -3,6 +3,7 @@
 
 package org.opendaylight.controller.protobuff.messages.cohort3pc;
 
+@Deprecated
 public final class ThreePhaseCommitCohortMessages {
   private ThreePhaseCommitCohortMessages() {}
   public static void registerAllExtensions(
@@ -44,6 +45,7 @@ public final class ThreePhaseCommitCohortMessages {
       return defaultInstance;
     }
 
+    @Override
     public CanCommitTransaction getDefaultInstanceForType() {
       return defaultInstance;
     }
@@ -99,6 +101,7 @@ public final class ThreePhaseCommitCohortMessages {
       return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransaction_descriptor;
     }
 
+    @Override
     protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
         internalGetFieldAccessorTable() {
       return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransaction_fieldAccessorTable
@@ -108,7 +111,8 @@ public final class ThreePhaseCommitCohortMessages {
 
     public static com.google.protobuf.Parser<CanCommitTransaction> PARSER =
         new com.google.protobuf.AbstractParser<CanCommitTransaction>() {
-      public CanCommitTransaction parsePartialFrom(
+      @Override
+    public CanCommitTransaction parsePartialFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws com.google.protobuf.InvalidProtocolBufferException {
@@ -128,12 +132,14 @@ public final class ThreePhaseCommitCohortMessages {
     /**
      * <code>optional string transactionId = 1;</code>
      */
+    @Override
     public boolean hasTransactionId() {
       return ((bitField0_ & 0x00000001) == 0x00000001);
     }
     /**
      * <code>optional string transactionId = 1;</code>
      */
+    @Override
     public java.lang.String getTransactionId() {
       java.lang.Object ref = transactionId_;
       if (ref instanceof java.lang.String) {
@@ -151,6 +157,7 @@ public final class ThreePhaseCommitCohortMessages {
     /**
      * <code>optional string transactionId = 1;</code>
      */
+    @Override
     public com.google.protobuf.ByteString
         getTransactionIdBytes() {
       java.lang.Object ref = transactionId_;
@@ -169,14 +176,18 @@ public final class ThreePhaseCommitCohortMessages {
       transactionId_ = "";
     }
     private byte memoizedIsInitialized = -1;
+    @Override
     public final boolean isInitialized() {
       byte isInitialized = memoizedIsInitialized;
-      if (isInitialized != -1) return isInitialized == 1;
+      if (isInitialized != -1) {
+        return isInitialized == 1;
+    }
 
       memoizedIsInitialized = 1;
       return true;
     }
 
+    @Override
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
       getSerializedSize();
@@ -187,9 +198,12 @@ public final class ThreePhaseCommitCohortMessages {
     }
 
     private int memoizedSerializedSize = -1;
+    @Override
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
-      if (size != -1) return size;
+      if (size != -1) {
+        return size;
+    }
 
       size = 0;
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
@@ -262,10 +276,12 @@ public final class ThreePhaseCommitCohortMessages {
     }
 
     public static Builder newBuilder() { return Builder.create(); }
+    @Override
     public Builder newBuilderForType() { return newBuilder(); }
     public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction prototype) {
       return newBuilder().mergeFrom(prototype);
     }
+    @Override
     public Builder toBuilder() { return newBuilder(this); }
 
     @java.lang.Override
@@ -285,7 +301,8 @@ public final class ThreePhaseCommitCohortMessages {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransaction_descriptor;
       }
 
-      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+      @Override
+    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransaction_fieldAccessorTable
             .ensureFieldAccessorsInitialized(
@@ -310,27 +327,32 @@ public final class ThreePhaseCommitCohortMessages {
         return new Builder();
       }
 
-      public Builder clear() {
+      @Override
+    public Builder clear() {
         super.clear();
         transactionId_ = "";
         bitField0_ = (bitField0_ & ~0x00000001);
         return this;
       }
 
-      public Builder clone() {
+      @Override
+    public Builder clone() {
         return create().mergeFrom(buildPartial());
       }
 
-      public com.google.protobuf.Descriptors.Descriptor
+      @Override
+    public com.google.protobuf.Descriptors.Descriptor
           getDescriptorForType() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransaction_descriptor;
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction getDefaultInstanceForType() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction getDefaultInstanceForType() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction.getDefaultInstance();
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction build() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction build() {
         org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction result = buildPartial();
         if (!result.isInitialized()) {
           throw newUninitializedMessageException(result);
@@ -338,7 +360,8 @@ public final class ThreePhaseCommitCohortMessages {
         return result;
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction buildPartial() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction buildPartial() {
         org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction result = new org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction(this);
         int from_bitField0_ = bitField0_;
         int to_bitField0_ = 0;
@@ -351,7 +374,8 @@ public final class ThreePhaseCommitCohortMessages {
         return result;
       }
 
-      public Builder mergeFrom(com.google.protobuf.Message other) {
+      @Override
+    public Builder mergeFrom(com.google.protobuf.Message other) {
         if (other instanceof org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction) {
           return mergeFrom((org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction)other);
         } else {
@@ -361,7 +385,9 @@ public final class ThreePhaseCommitCohortMessages {
       }
 
       public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction other) {
-        if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction.getDefaultInstance()) return this;
+        if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransaction.getDefaultInstance()) {
+            return this;
+        }
         if (other.hasTransactionId()) {
           bitField0_ |= 0x00000001;
           transactionId_ = other.transactionId_;
@@ -371,11 +397,13 @@ public final class ThreePhaseCommitCohortMessages {
         return this;
       }
 
-      public final boolean isInitialized() {
+      @Override
+    public final boolean isInitialized() {
         return true;
       }
 
-      public Builder mergeFrom(
+      @Override
+    public Builder mergeFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws java.io.IOException {
@@ -399,13 +427,15 @@ public final class ThreePhaseCommitCohortMessages {
       /**
        * <code>optional string transactionId = 1;</code>
        */
-      public boolean hasTransactionId() {
+      @Override
+    public boolean hasTransactionId() {
         return ((bitField0_ & 0x00000001) == 0x00000001);
       }
       /**
        * <code>optional string transactionId = 1;</code>
        */
-      public java.lang.String getTransactionId() {
+      @Override
+    public java.lang.String getTransactionId() {
         java.lang.Object ref = transactionId_;
         if (!(ref instanceof java.lang.String)) {
           java.lang.String s = ((com.google.protobuf.ByteString) ref)
@@ -419,7 +449,8 @@ public final class ThreePhaseCommitCohortMessages {
       /**
        * <code>optional string transactionId = 1;</code>
        */
-      public com.google.protobuf.ByteString
+      @Override
+    public com.google.protobuf.ByteString
           getTransactionIdBytes() {
         java.lang.Object ref = transactionId_;
         if (ref instanceof String) {
@@ -510,6 +541,7 @@ public final class ThreePhaseCommitCohortMessages {
       return defaultInstance;
     }
 
+    @Override
     public CanCommitTransactionReply getDefaultInstanceForType() {
       return defaultInstance;
     }
@@ -565,6 +597,7 @@ public final class ThreePhaseCommitCohortMessages {
       return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransactionReply_descriptor;
     }
 
+    @Override
     protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
         internalGetFieldAccessorTable() {
       return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransactionReply_fieldAccessorTable
@@ -574,7 +607,8 @@ public final class ThreePhaseCommitCohortMessages {
 
     public static com.google.protobuf.Parser<CanCommitTransactionReply> PARSER =
         new com.google.protobuf.AbstractParser<CanCommitTransactionReply>() {
-      public CanCommitTransactionReply parsePartialFrom(
+      @Override
+    public CanCommitTransactionReply parsePartialFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws com.google.protobuf.InvalidProtocolBufferException {
@@ -594,12 +628,14 @@ public final class ThreePhaseCommitCohortMessages {
     /**
      * <code>required bool canCommit = 1;</code>
      */
+    @Override
     public boolean hasCanCommit() {
       return ((bitField0_ & 0x00000001) == 0x00000001);
     }
     /**
      * <code>required bool canCommit = 1;</code>
      */
+    @Override
     public boolean getCanCommit() {
       return canCommit_;
     }
@@ -608,9 +644,12 @@ public final class ThreePhaseCommitCohortMessages {
       canCommit_ = false;
     }
     private byte memoizedIsInitialized = -1;
+    @Override
     public final boolean isInitialized() {
       byte isInitialized = memoizedIsInitialized;
-      if (isInitialized != -1) return isInitialized == 1;
+      if (isInitialized != -1) {
+        return isInitialized == 1;
+    }
 
       if (!hasCanCommit()) {
         memoizedIsInitialized = 0;
@@ -620,6 +659,7 @@ public final class ThreePhaseCommitCohortMessages {
       return true;
     }
 
+    @Override
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
       getSerializedSize();
@@ -630,9 +670,12 @@ public final class ThreePhaseCommitCohortMessages {
     }
 
     private int memoizedSerializedSize = -1;
+    @Override
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
-      if (size != -1) return size;
+      if (size != -1) {
+        return size;
+    }
 
       size = 0;
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
@@ -705,10 +748,12 @@ public final class ThreePhaseCommitCohortMessages {
     }
 
     public static Builder newBuilder() { return Builder.create(); }
+    @Override
     public Builder newBuilderForType() { return newBuilder(); }
     public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply prototype) {
       return newBuilder().mergeFrom(prototype);
     }
+    @Override
     public Builder toBuilder() { return newBuilder(this); }
 
     @java.lang.Override
@@ -728,7 +773,8 @@ public final class ThreePhaseCommitCohortMessages {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransactionReply_descriptor;
       }
 
-      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+      @Override
+    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransactionReply_fieldAccessorTable
             .ensureFieldAccessorsInitialized(
@@ -753,27 +799,32 @@ public final class ThreePhaseCommitCohortMessages {
         return new Builder();
       }
 
-      public Builder clear() {
+      @Override
+    public Builder clear() {
         super.clear();
         canCommit_ = false;
         bitField0_ = (bitField0_ & ~0x00000001);
         return this;
       }
 
-      public Builder clone() {
+      @Override
+    public Builder clone() {
         return create().mergeFrom(buildPartial());
       }
 
-      public com.google.protobuf.Descriptors.Descriptor
+      @Override
+    public com.google.protobuf.Descriptors.Descriptor
           getDescriptorForType() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CanCommitTransactionReply_descriptor;
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply getDefaultInstanceForType() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply getDefaultInstanceForType() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply.getDefaultInstance();
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply build() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply build() {
         org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply result = buildPartial();
         if (!result.isInitialized()) {
           throw newUninitializedMessageException(result);
@@ -781,7 +832,8 @@ public final class ThreePhaseCommitCohortMessages {
         return result;
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply buildPartial() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply buildPartial() {
         org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply result = new org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply(this);
         int from_bitField0_ = bitField0_;
         int to_bitField0_ = 0;
@@ -794,7 +846,8 @@ public final class ThreePhaseCommitCohortMessages {
         return result;
       }
 
-      public Builder mergeFrom(com.google.protobuf.Message other) {
+      @Override
+    public Builder mergeFrom(com.google.protobuf.Message other) {
         if (other instanceof org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply) {
           return mergeFrom((org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply)other);
         } else {
@@ -804,7 +857,9 @@ public final class ThreePhaseCommitCohortMessages {
       }
 
       public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply other) {
-        if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply.getDefaultInstance()) return this;
+        if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CanCommitTransactionReply.getDefaultInstance()) {
+            return this;
+        }
         if (other.hasCanCommit()) {
           setCanCommit(other.getCanCommit());
         }
@@ -812,7 +867,8 @@ public final class ThreePhaseCommitCohortMessages {
         return this;
       }
 
-      public final boolean isInitialized() {
+      @Override
+    public final boolean isInitialized() {
         if (!hasCanCommit()) {
 
           return false;
@@ -820,7 +876,8 @@ public final class ThreePhaseCommitCohortMessages {
         return true;
       }
 
-      public Builder mergeFrom(
+      @Override
+    public Builder mergeFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws java.io.IOException {
@@ -844,13 +901,15 @@ public final class ThreePhaseCommitCohortMessages {
       /**
        * <code>required bool canCommit = 1;</code>
        */
-      public boolean hasCanCommit() {
+      @Override
+    public boolean hasCanCommit() {
         return ((bitField0_ & 0x00000001) == 0x00000001);
       }
       /**
        * <code>required bool canCommit = 1;</code>
        */
-      public boolean getCanCommit() {
+      @Override
+    public boolean getCanCommit() {
         return canCommit_;
       }
       /**
@@ -919,6 +978,7 @@ public final class ThreePhaseCommitCohortMessages {
       return defaultInstance;
     }
 
+    @Override
     public AbortTransaction getDefaultInstanceForType() {
       return defaultInstance;
     }
@@ -974,6 +1034,7 @@ public final class ThreePhaseCommitCohortMessages {
       return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransaction_descriptor;
     }
 
+    @Override
     protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
         internalGetFieldAccessorTable() {
       return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransaction_fieldAccessorTable
@@ -983,7 +1044,8 @@ public final class ThreePhaseCommitCohortMessages {
 
     public static com.google.protobuf.Parser<AbortTransaction> PARSER =
         new com.google.protobuf.AbstractParser<AbortTransaction>() {
-      public AbortTransaction parsePartialFrom(
+      @Override
+    public AbortTransaction parsePartialFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws com.google.protobuf.InvalidProtocolBufferException {
@@ -1003,12 +1065,14 @@ public final class ThreePhaseCommitCohortMessages {
     /**
      * <code>optional string transactionId = 1;</code>
      */
+    @Override
     public boolean hasTransactionId() {
       return ((bitField0_ & 0x00000001) == 0x00000001);
     }
     /**
      * <code>optional string transactionId = 1;</code>
      */
+    @Override
     public java.lang.String getTransactionId() {
       java.lang.Object ref = transactionId_;
       if (ref instanceof java.lang.String) {
@@ -1026,6 +1090,7 @@ public final class ThreePhaseCommitCohortMessages {
     /**
      * <code>optional string transactionId = 1;</code>
      */
+    @Override
     public com.google.protobuf.ByteString
         getTransactionIdBytes() {
       java.lang.Object ref = transactionId_;
@@ -1044,14 +1109,18 @@ public final class ThreePhaseCommitCohortMessages {
       transactionId_ = "";
     }
     private byte memoizedIsInitialized = -1;
+    @Override
     public final boolean isInitialized() {
       byte isInitialized = memoizedIsInitialized;
-      if (isInitialized != -1) return isInitialized == 1;
+      if (isInitialized != -1) {
+        return isInitialized == 1;
+    }
 
       memoizedIsInitialized = 1;
       return true;
     }
 
+    @Override
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
       getSerializedSize();
@@ -1062,9 +1131,12 @@ public final class ThreePhaseCommitCohortMessages {
     }
 
     private int memoizedSerializedSize = -1;
+    @Override
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
-      if (size != -1) return size;
+      if (size != -1) {
+        return size;
+    }
 
       size = 0;
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
@@ -1137,10 +1209,12 @@ public final class ThreePhaseCommitCohortMessages {
     }
 
     public static Builder newBuilder() { return Builder.create(); }
+    @Override
     public Builder newBuilderForType() { return newBuilder(); }
     public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction prototype) {
       return newBuilder().mergeFrom(prototype);
     }
+    @Override
     public Builder toBuilder() { return newBuilder(this); }
 
     @java.lang.Override
@@ -1160,7 +1234,8 @@ public final class ThreePhaseCommitCohortMessages {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransaction_descriptor;
       }
 
-      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+      @Override
+    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransaction_fieldAccessorTable
             .ensureFieldAccessorsInitialized(
@@ -1185,27 +1260,32 @@ public final class ThreePhaseCommitCohortMessages {
         return new Builder();
       }
 
-      public Builder clear() {
+      @Override
+    public Builder clear() {
         super.clear();
         transactionId_ = "";
         bitField0_ = (bitField0_ & ~0x00000001);
         return this;
       }
 
-      public Builder clone() {
+      @Override
+    public Builder clone() {
         return create().mergeFrom(buildPartial());
       }
 
-      public com.google.protobuf.Descriptors.Descriptor
+      @Override
+    public com.google.protobuf.Descriptors.Descriptor
           getDescriptorForType() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransaction_descriptor;
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction getDefaultInstanceForType() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction getDefaultInstanceForType() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction.getDefaultInstance();
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction build() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction build() {
         org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction result = buildPartial();
         if (!result.isInitialized()) {
           throw newUninitializedMessageException(result);
@@ -1213,7 +1293,8 @@ public final class ThreePhaseCommitCohortMessages {
         return result;
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction buildPartial() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction buildPartial() {
         org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction result = new org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction(this);
         int from_bitField0_ = bitField0_;
         int to_bitField0_ = 0;
@@ -1226,7 +1307,8 @@ public final class ThreePhaseCommitCohortMessages {
         return result;
       }
 
-      public Builder mergeFrom(com.google.protobuf.Message other) {
+      @Override
+    public Builder mergeFrom(com.google.protobuf.Message other) {
         if (other instanceof org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction) {
           return mergeFrom((org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction)other);
         } else {
@@ -1236,7 +1318,9 @@ public final class ThreePhaseCommitCohortMessages {
       }
 
       public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction other) {
-        if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction.getDefaultInstance()) return this;
+        if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransaction.getDefaultInstance()) {
+            return this;
+        }
         if (other.hasTransactionId()) {
           bitField0_ |= 0x00000001;
           transactionId_ = other.transactionId_;
@@ -1246,11 +1330,13 @@ public final class ThreePhaseCommitCohortMessages {
         return this;
       }
 
-      public final boolean isInitialized() {
+      @Override
+    public final boolean isInitialized() {
         return true;
       }
 
-      public Builder mergeFrom(
+      @Override
+    public Builder mergeFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws java.io.IOException {
@@ -1274,13 +1360,15 @@ public final class ThreePhaseCommitCohortMessages {
       /**
        * <code>optional string transactionId = 1;</code>
        */
-      public boolean hasTransactionId() {
+      @Override
+    public boolean hasTransactionId() {
         return ((bitField0_ & 0x00000001) == 0x00000001);
       }
       /**
        * <code>optional string transactionId = 1;</code>
        */
-      public java.lang.String getTransactionId() {
+      @Override
+    public java.lang.String getTransactionId() {
         java.lang.Object ref = transactionId_;
         if (!(ref instanceof java.lang.String)) {
           java.lang.String s = ((com.google.protobuf.ByteString) ref)
@@ -1294,7 +1382,8 @@ public final class ThreePhaseCommitCohortMessages {
       /**
        * <code>optional string transactionId = 1;</code>
        */
-      public com.google.protobuf.ByteString
+      @Override
+    public com.google.protobuf.ByteString
           getTransactionIdBytes() {
         java.lang.Object ref = transactionId_;
         if (ref instanceof String) {
@@ -1375,6 +1464,7 @@ public final class ThreePhaseCommitCohortMessages {
       return defaultInstance;
     }
 
+    @Override
     public AbortTransactionReply getDefaultInstanceForType() {
       return defaultInstance;
     }
@@ -1424,6 +1514,7 @@ public final class ThreePhaseCommitCohortMessages {
       return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransactionReply_descriptor;
     }
 
+    @Override
     protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
         internalGetFieldAccessorTable() {
       return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransactionReply_fieldAccessorTable
@@ -1433,7 +1524,8 @@ public final class ThreePhaseCommitCohortMessages {
 
     public static com.google.protobuf.Parser<AbortTransactionReply> PARSER =
         new com.google.protobuf.AbstractParser<AbortTransactionReply>() {
-      public AbortTransactionReply parsePartialFrom(
+      @Override
+    public AbortTransactionReply parsePartialFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws com.google.protobuf.InvalidProtocolBufferException {
@@ -1449,14 +1541,18 @@ public final class ThreePhaseCommitCohortMessages {
     private void initFields() {
     }
     private byte memoizedIsInitialized = -1;
+    @Override
     public final boolean isInitialized() {
       byte isInitialized = memoizedIsInitialized;
-      if (isInitialized != -1) return isInitialized == 1;
+      if (isInitialized != -1) {
+        return isInitialized == 1;
+    }
 
       memoizedIsInitialized = 1;
       return true;
     }
 
+    @Override
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
       getSerializedSize();
@@ -1464,9 +1560,12 @@ public final class ThreePhaseCommitCohortMessages {
     }
 
     private int memoizedSerializedSize = -1;
+    @Override
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
-      if (size != -1) return size;
+      if (size != -1) {
+        return size;
+    }
 
       size = 0;
       size += getUnknownFields().getSerializedSize();
@@ -1535,10 +1634,12 @@ public final class ThreePhaseCommitCohortMessages {
     }
 
     public static Builder newBuilder() { return Builder.create(); }
+    @Override
     public Builder newBuilderForType() { return newBuilder(); }
     public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply prototype) {
       return newBuilder().mergeFrom(prototype);
     }
+    @Override
     public Builder toBuilder() { return newBuilder(this); }
 
     @java.lang.Override
@@ -1558,7 +1659,8 @@ public final class ThreePhaseCommitCohortMessages {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransactionReply_descriptor;
       }
 
-      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+      @Override
+    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransactionReply_fieldAccessorTable
             .ensureFieldAccessorsInitialized(
@@ -1583,25 +1685,30 @@ public final class ThreePhaseCommitCohortMessages {
         return new Builder();
       }
 
-      public Builder clear() {
+      @Override
+    public Builder clear() {
         super.clear();
         return this;
       }
 
-      public Builder clone() {
+      @Override
+    public Builder clone() {
         return create().mergeFrom(buildPartial());
       }
 
-      public com.google.protobuf.Descriptors.Descriptor
+      @Override
+    public com.google.protobuf.Descriptors.Descriptor
           getDescriptorForType() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_AbortTransactionReply_descriptor;
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply getDefaultInstanceForType() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply getDefaultInstanceForType() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply.getDefaultInstance();
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply build() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply build() {
         org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply result = buildPartial();
         if (!result.isInitialized()) {
           throw newUninitializedMessageException(result);
@@ -1609,13 +1716,15 @@ public final class ThreePhaseCommitCohortMessages {
         return result;
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply buildPartial() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply buildPartial() {
         org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply result = new org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply(this);
         onBuilt();
         return result;
       }
 
-      public Builder mergeFrom(com.google.protobuf.Message other) {
+      @Override
+    public Builder mergeFrom(com.google.protobuf.Message other) {
         if (other instanceof org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply) {
           return mergeFrom((org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply)other);
         } else {
@@ -1625,16 +1734,20 @@ public final class ThreePhaseCommitCohortMessages {
       }
 
       public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply other) {
-        if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply.getDefaultInstance()) return this;
+        if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.AbortTransactionReply.getDefaultInstance()) {
+            return this;
+        }
         this.mergeUnknownFields(other.getUnknownFields());
         return this;
       }
 
-      public final boolean isInitialized() {
+      @Override
+    public final boolean isInitialized() {
         return true;
       }
 
-      public Builder mergeFrom(
+      @Override
+    public Builder mergeFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws java.io.IOException {
@@ -1699,6 +1812,7 @@ public final class ThreePhaseCommitCohortMessages {
       return defaultInstance;
     }
 
+    @Override
     public CommitTransaction getDefaultInstanceForType() {
       return defaultInstance;
     }
@@ -1754,6 +1868,7 @@ public final class ThreePhaseCommitCohortMessages {
       return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransaction_descriptor;
     }
 
+    @Override
     protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
         internalGetFieldAccessorTable() {
       return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransaction_fieldAccessorTable
@@ -1763,7 +1878,8 @@ public final class ThreePhaseCommitCohortMessages {
 
     public static com.google.protobuf.Parser<CommitTransaction> PARSER =
         new com.google.protobuf.AbstractParser<CommitTransaction>() {
-      public CommitTransaction parsePartialFrom(
+      @Override
+    public CommitTransaction parsePartialFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws com.google.protobuf.InvalidProtocolBufferException {
@@ -1783,12 +1899,14 @@ public final class ThreePhaseCommitCohortMessages {
     /**
      * <code>optional string transactionId = 1;</code>
      */
+    @Override
     public boolean hasTransactionId() {
       return ((bitField0_ & 0x00000001) == 0x00000001);
     }
     /**
      * <code>optional string transactionId = 1;</code>
      */
+    @Override
     public java.lang.String getTransactionId() {
       java.lang.Object ref = transactionId_;
       if (ref instanceof java.lang.String) {
@@ -1806,6 +1924,7 @@ public final class ThreePhaseCommitCohortMessages {
     /**
      * <code>optional string transactionId = 1;</code>
      */
+    @Override
     public com.google.protobuf.ByteString
         getTransactionIdBytes() {
       java.lang.Object ref = transactionId_;
@@ -1824,14 +1943,18 @@ public final class ThreePhaseCommitCohortMessages {
       transactionId_ = "";
     }
     private byte memoizedIsInitialized = -1;
+    @Override
     public final boolean isInitialized() {
       byte isInitialized = memoizedIsInitialized;
-      if (isInitialized != -1) return isInitialized == 1;
+      if (isInitialized != -1) {
+        return isInitialized == 1;
+    }
 
       memoizedIsInitialized = 1;
       return true;
     }
 
+    @Override
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
       getSerializedSize();
@@ -1842,9 +1965,12 @@ public final class ThreePhaseCommitCohortMessages {
     }
 
     private int memoizedSerializedSize = -1;
+    @Override
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
-      if (size != -1) return size;
+      if (size != -1) {
+        return size;
+    }
 
       size = 0;
       if (((bitField0_ & 0x00000001) == 0x00000001)) {
@@ -1917,10 +2043,12 @@ public final class ThreePhaseCommitCohortMessages {
     }
 
     public static Builder newBuilder() { return Builder.create(); }
+    @Override
     public Builder newBuilderForType() { return newBuilder(); }
     public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction prototype) {
       return newBuilder().mergeFrom(prototype);
     }
+    @Override
     public Builder toBuilder() { return newBuilder(this); }
 
     @java.lang.Override
@@ -1940,7 +2068,8 @@ public final class ThreePhaseCommitCohortMessages {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransaction_descriptor;
       }
 
-      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+      @Override
+    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransaction_fieldAccessorTable
             .ensureFieldAccessorsInitialized(
@@ -1965,27 +2094,32 @@ public final class ThreePhaseCommitCohortMessages {
         return new Builder();
       }
 
-      public Builder clear() {
+      @Override
+    public Builder clear() {
         super.clear();
         transactionId_ = "";
         bitField0_ = (bitField0_ & ~0x00000001);
         return this;
       }
 
-      public Builder clone() {
+      @Override
+    public Builder clone() {
         return create().mergeFrom(buildPartial());
       }
 
-      public com.google.protobuf.Descriptors.Descriptor
+      @Override
+    public com.google.protobuf.Descriptors.Descriptor
           getDescriptorForType() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransaction_descriptor;
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction getDefaultInstanceForType() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction getDefaultInstanceForType() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction.getDefaultInstance();
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction build() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction build() {
         org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction result = buildPartial();
         if (!result.isInitialized()) {
           throw newUninitializedMessageException(result);
@@ -1993,7 +2127,8 @@ public final class ThreePhaseCommitCohortMessages {
         return result;
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction buildPartial() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction buildPartial() {
         org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction result = new org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction(this);
         int from_bitField0_ = bitField0_;
         int to_bitField0_ = 0;
@@ -2006,7 +2141,8 @@ public final class ThreePhaseCommitCohortMessages {
         return result;
       }
 
-      public Builder mergeFrom(com.google.protobuf.Message other) {
+      @Override
+    public Builder mergeFrom(com.google.protobuf.Message other) {
         if (other instanceof org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction) {
           return mergeFrom((org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction)other);
         } else {
@@ -2016,7 +2152,9 @@ public final class ThreePhaseCommitCohortMessages {
       }
 
       public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction other) {
-        if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction.getDefaultInstance()) return this;
+        if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransaction.getDefaultInstance()) {
+            return this;
+        }
         if (other.hasTransactionId()) {
           bitField0_ |= 0x00000001;
           transactionId_ = other.transactionId_;
@@ -2026,11 +2164,13 @@ public final class ThreePhaseCommitCohortMessages {
         return this;
       }
 
-      public final boolean isInitialized() {
+      @Override
+    public final boolean isInitialized() {
         return true;
       }
 
-      public Builder mergeFrom(
+      @Override
+    public Builder mergeFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws java.io.IOException {
@@ -2054,13 +2194,15 @@ public final class ThreePhaseCommitCohortMessages {
       /**
        * <code>optional string transactionId = 1;</code>
        */
-      public boolean hasTransactionId() {
+      @Override
+    public boolean hasTransactionId() {
         return ((bitField0_ & 0x00000001) == 0x00000001);
       }
       /**
        * <code>optional string transactionId = 1;</code>
        */
-      public java.lang.String getTransactionId() {
+      @Override
+    public java.lang.String getTransactionId() {
         java.lang.Object ref = transactionId_;
         if (!(ref instanceof java.lang.String)) {
           java.lang.String s = ((com.google.protobuf.ByteString) ref)
@@ -2074,7 +2216,8 @@ public final class ThreePhaseCommitCohortMessages {
       /**
        * <code>optional string transactionId = 1;</code>
        */
-      public com.google.protobuf.ByteString
+      @Override
+    public com.google.protobuf.ByteString
           getTransactionIdBytes() {
         java.lang.Object ref = transactionId_;
         if (ref instanceof String) {
@@ -2155,6 +2298,7 @@ public final class ThreePhaseCommitCohortMessages {
       return defaultInstance;
     }
 
+    @Override
     public CommitTransactionReply getDefaultInstanceForType() {
       return defaultInstance;
     }
@@ -2204,6 +2348,7 @@ public final class ThreePhaseCommitCohortMessages {
       return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransactionReply_descriptor;
     }
 
+    @Override
     protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
         internalGetFieldAccessorTable() {
       return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransactionReply_fieldAccessorTable
@@ -2213,7 +2358,8 @@ public final class ThreePhaseCommitCohortMessages {
 
     public static com.google.protobuf.Parser<CommitTransactionReply> PARSER =
         new com.google.protobuf.AbstractParser<CommitTransactionReply>() {
-      public CommitTransactionReply parsePartialFrom(
+      @Override
+    public CommitTransactionReply parsePartialFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws com.google.protobuf.InvalidProtocolBufferException {
@@ -2229,14 +2375,18 @@ public final class ThreePhaseCommitCohortMessages {
     private void initFields() {
     }
     private byte memoizedIsInitialized = -1;
+    @Override
     public final boolean isInitialized() {
       byte isInitialized = memoizedIsInitialized;
-      if (isInitialized != -1) return isInitialized == 1;
+      if (isInitialized != -1) {
+        return isInitialized == 1;
+    }
 
       memoizedIsInitialized = 1;
       return true;
     }
 
+    @Override
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
       getSerializedSize();
@@ -2244,9 +2394,12 @@ public final class ThreePhaseCommitCohortMessages {
     }
 
     private int memoizedSerializedSize = -1;
+    @Override
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
-      if (size != -1) return size;
+      if (size != -1) {
+        return size;
+    }
 
       size = 0;
       size += getUnknownFields().getSerializedSize();
@@ -2315,10 +2468,12 @@ public final class ThreePhaseCommitCohortMessages {
     }
 
     public static Builder newBuilder() { return Builder.create(); }
+    @Override
     public Builder newBuilderForType() { return newBuilder(); }
     public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply prototype) {
       return newBuilder().mergeFrom(prototype);
     }
+    @Override
     public Builder toBuilder() { return newBuilder(this); }
 
     @java.lang.Override
@@ -2338,7 +2493,8 @@ public final class ThreePhaseCommitCohortMessages {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransactionReply_descriptor;
       }
 
-      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+      @Override
+    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransactionReply_fieldAccessorTable
             .ensureFieldAccessorsInitialized(
@@ -2363,25 +2519,30 @@ public final class ThreePhaseCommitCohortMessages {
         return new Builder();
       }
 
-      public Builder clear() {
+      @Override
+    public Builder clear() {
         super.clear();
         return this;
       }
 
-      public Builder clone() {
+      @Override
+    public Builder clone() {
         return create().mergeFrom(buildPartial());
       }
 
-      public com.google.protobuf.Descriptors.Descriptor
+      @Override
+    public com.google.protobuf.Descriptors.Descriptor
           getDescriptorForType() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_CommitTransactionReply_descriptor;
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply getDefaultInstanceForType() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply getDefaultInstanceForType() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply.getDefaultInstance();
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply build() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply build() {
         org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply result = buildPartial();
         if (!result.isInitialized()) {
           throw newUninitializedMessageException(result);
@@ -2389,13 +2550,15 @@ public final class ThreePhaseCommitCohortMessages {
         return result;
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply buildPartial() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply buildPartial() {
         org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply result = new org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply(this);
         onBuilt();
         return result;
       }
 
-      public Builder mergeFrom(com.google.protobuf.Message other) {
+      @Override
+    public Builder mergeFrom(com.google.protobuf.Message other) {
         if (other instanceof org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply) {
           return mergeFrom((org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply)other);
         } else {
@@ -2405,16 +2568,20 @@ public final class ThreePhaseCommitCohortMessages {
       }
 
       public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply other) {
-        if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply.getDefaultInstance()) return this;
+        if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.CommitTransactionReply.getDefaultInstance()) {
+            return this;
+        }
         this.mergeUnknownFields(other.getUnknownFields());
         return this;
       }
 
-      public final boolean isInitialized() {
+      @Override
+    public final boolean isInitialized() {
         return true;
       }
 
-      public Builder mergeFrom(
+      @Override
+    public Builder mergeFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws java.io.IOException {
@@ -2464,6 +2631,7 @@ public final class ThreePhaseCommitCohortMessages {
       return defaultInstance;
     }
 
+    @Override
     public PreCommitTransaction getDefaultInstanceForType() {
       return defaultInstance;
     }
@@ -2513,6 +2681,7 @@ public final class ThreePhaseCommitCohortMessages {
       return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransaction_descriptor;
     }
 
+    @Override
     protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
         internalGetFieldAccessorTable() {
       return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransaction_fieldAccessorTable
@@ -2522,7 +2691,8 @@ public final class ThreePhaseCommitCohortMessages {
 
     public static com.google.protobuf.Parser<PreCommitTransaction> PARSER =
         new com.google.protobuf.AbstractParser<PreCommitTransaction>() {
-      public PreCommitTransaction parsePartialFrom(
+      @Override
+    public PreCommitTransaction parsePartialFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws com.google.protobuf.InvalidProtocolBufferException {
@@ -2538,14 +2708,18 @@ public final class ThreePhaseCommitCohortMessages {
     private void initFields() {
     }
     private byte memoizedIsInitialized = -1;
+    @Override
     public final boolean isInitialized() {
       byte isInitialized = memoizedIsInitialized;
-      if (isInitialized != -1) return isInitialized == 1;
+      if (isInitialized != -1) {
+        return isInitialized == 1;
+    }
 
       memoizedIsInitialized = 1;
       return true;
     }
 
+    @Override
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
       getSerializedSize();
@@ -2553,9 +2727,12 @@ public final class ThreePhaseCommitCohortMessages {
     }
 
     private int memoizedSerializedSize = -1;
+    @Override
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
-      if (size != -1) return size;
+      if (size != -1) {
+        return size;
+    }
 
       size = 0;
       size += getUnknownFields().getSerializedSize();
@@ -2624,10 +2801,12 @@ public final class ThreePhaseCommitCohortMessages {
     }
 
     public static Builder newBuilder() { return Builder.create(); }
+    @Override
     public Builder newBuilderForType() { return newBuilder(); }
     public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction prototype) {
       return newBuilder().mergeFrom(prototype);
     }
+    @Override
     public Builder toBuilder() { return newBuilder(this); }
 
     @java.lang.Override
@@ -2647,7 +2826,8 @@ public final class ThreePhaseCommitCohortMessages {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransaction_descriptor;
       }
 
-      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+      @Override
+    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransaction_fieldAccessorTable
             .ensureFieldAccessorsInitialized(
@@ -2672,25 +2852,30 @@ public final class ThreePhaseCommitCohortMessages {
         return new Builder();
       }
 
-      public Builder clear() {
+      @Override
+    public Builder clear() {
         super.clear();
         return this;
       }
 
-      public Builder clone() {
+      @Override
+    public Builder clone() {
         return create().mergeFrom(buildPartial());
       }
 
-      public com.google.protobuf.Descriptors.Descriptor
+      @Override
+    public com.google.protobuf.Descriptors.Descriptor
           getDescriptorForType() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransaction_descriptor;
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction getDefaultInstanceForType() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction getDefaultInstanceForType() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction.getDefaultInstance();
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction build() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction build() {
         org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction result = buildPartial();
         if (!result.isInitialized()) {
           throw newUninitializedMessageException(result);
@@ -2698,13 +2883,15 @@ public final class ThreePhaseCommitCohortMessages {
         return result;
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction buildPartial() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction buildPartial() {
         org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction result = new org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction(this);
         onBuilt();
         return result;
       }
 
-      public Builder mergeFrom(com.google.protobuf.Message other) {
+      @Override
+    public Builder mergeFrom(com.google.protobuf.Message other) {
         if (other instanceof org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction) {
           return mergeFrom((org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction)other);
         } else {
@@ -2714,16 +2901,20 @@ public final class ThreePhaseCommitCohortMessages {
       }
 
       public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction other) {
-        if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction.getDefaultInstance()) return this;
+        if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransaction.getDefaultInstance()) {
+            return this;
+        }
         this.mergeUnknownFields(other.getUnknownFields());
         return this;
       }
 
-      public final boolean isInitialized() {
+      @Override
+    public final boolean isInitialized() {
         return true;
       }
 
-      public Builder mergeFrom(
+      @Override
+    public Builder mergeFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws java.io.IOException {
@@ -2773,6 +2964,7 @@ public final class ThreePhaseCommitCohortMessages {
       return defaultInstance;
     }
 
+    @Override
     public PreCommitTransactionReply getDefaultInstanceForType() {
       return defaultInstance;
     }
@@ -2822,6 +3014,7 @@ public final class ThreePhaseCommitCohortMessages {
       return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransactionReply_descriptor;
     }
 
+    @Override
     protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
         internalGetFieldAccessorTable() {
       return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransactionReply_fieldAccessorTable
@@ -2831,7 +3024,8 @@ public final class ThreePhaseCommitCohortMessages {
 
     public static com.google.protobuf.Parser<PreCommitTransactionReply> PARSER =
         new com.google.protobuf.AbstractParser<PreCommitTransactionReply>() {
-      public PreCommitTransactionReply parsePartialFrom(
+      @Override
+    public PreCommitTransactionReply parsePartialFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws com.google.protobuf.InvalidProtocolBufferException {
@@ -2847,14 +3041,18 @@ public final class ThreePhaseCommitCohortMessages {
     private void initFields() {
     }
     private byte memoizedIsInitialized = -1;
+    @Override
     public final boolean isInitialized() {
       byte isInitialized = memoizedIsInitialized;
-      if (isInitialized != -1) return isInitialized == 1;
+      if (isInitialized != -1) {
+        return isInitialized == 1;
+    }
 
       memoizedIsInitialized = 1;
       return true;
     }
 
+    @Override
     public void writeTo(com.google.protobuf.CodedOutputStream output)
                         throws java.io.IOException {
       getSerializedSize();
@@ -2862,9 +3060,12 @@ public final class ThreePhaseCommitCohortMessages {
     }
 
     private int memoizedSerializedSize = -1;
+    @Override
     public int getSerializedSize() {
       int size = memoizedSerializedSize;
-      if (size != -1) return size;
+      if (size != -1) {
+        return size;
+    }
 
       size = 0;
       size += getUnknownFields().getSerializedSize();
@@ -2933,10 +3134,12 @@ public final class ThreePhaseCommitCohortMessages {
     }
 
     public static Builder newBuilder() { return Builder.create(); }
+    @Override
     public Builder newBuilderForType() { return newBuilder(); }
     public static Builder newBuilder(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply prototype) {
       return newBuilder().mergeFrom(prototype);
     }
+    @Override
     public Builder toBuilder() { return newBuilder(this); }
 
     @java.lang.Override
@@ -2956,7 +3159,8 @@ public final class ThreePhaseCommitCohortMessages {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransactionReply_descriptor;
       }
 
-      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+      @Override
+    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransactionReply_fieldAccessorTable
             .ensureFieldAccessorsInitialized(
@@ -2981,25 +3185,30 @@ public final class ThreePhaseCommitCohortMessages {
         return new Builder();
       }
 
-      public Builder clear() {
+      @Override
+    public Builder clear() {
         super.clear();
         return this;
       }
 
-      public Builder clone() {
+      @Override
+    public Builder clone() {
         return create().mergeFrom(buildPartial());
       }
 
-      public com.google.protobuf.Descriptors.Descriptor
+      @Override
+    public com.google.protobuf.Descriptors.Descriptor
           getDescriptorForType() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.internal_static_org_opendaylight_controller_mdsal_PreCommitTransactionReply_descriptor;
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply getDefaultInstanceForType() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply getDefaultInstanceForType() {
         return org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply.getDefaultInstance();
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply build() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply build() {
         org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply result = buildPartial();
         if (!result.isInitialized()) {
           throw newUninitializedMessageException(result);
@@ -3007,13 +3216,15 @@ public final class ThreePhaseCommitCohortMessages {
         return result;
       }
 
-      public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply buildPartial() {
+      @Override
+    public org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply buildPartial() {
         org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply result = new org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply(this);
         onBuilt();
         return result;
       }
 
-      public Builder mergeFrom(com.google.protobuf.Message other) {
+      @Override
+    public Builder mergeFrom(com.google.protobuf.Message other) {
         if (other instanceof org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply) {
           return mergeFrom((org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply)other);
         } else {
@@ -3023,16 +3234,20 @@ public final class ThreePhaseCommitCohortMessages {
       }
 
       public Builder mergeFrom(org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply other) {
-        if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply.getDefaultInstance()) return this;
+        if (other == org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages.PreCommitTransactionReply.getDefaultInstance()) {
+            return this;
+        }
         this.mergeUnknownFields(other.getUnknownFields());
         return this;
       }
 
-      public final boolean isInitialized() {
+      @Override
+    public final boolean isInitialized() {
         return true;
       }
 
-      public Builder mergeFrom(
+      @Override
+    public Builder mergeFrom(
           com.google.protobuf.CodedInputStream input,
           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
           throws java.io.IOException {
@@ -3124,6 +3339,7 @@ public final class ThreePhaseCommitCohortMessages {
     };
     com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
       new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
+        @Override
         public com.google.protobuf.ExtensionRegistry assignDescriptors(
             com.google.protobuf.Descriptors.FileDescriptor root) {
           descriptor = root;
index 5323adb..ec7b46d 100644 (file)
@@ -95,7 +95,7 @@ class LocalThreePhaseCommitCohort implements DOMStoreThreePhaseCommitCohort {
                 if (failure != null) {
                     LOG.error("Failed to prepare transaction {} on backend", transaction.getIdentifier(), failure);
                     transactionAborted(transaction);
-                } else if (CommitTransactionReply.SERIALIZABLE_CLASS.isInstance(message)) {
+                } else if (CommitTransactionReply.isSerializedType(message)) {
                     LOG.debug("Transaction {} committed successfully", transaction.getIdentifier());
                     transactionCommitted(transaction);
                 } else {
index 3cab853..18be295 100644 (file)
@@ -234,11 +234,11 @@ public class Shard extends RaftActor {
                 handleForwardedReadyTransaction((ForwardedReadyTransaction) message);
             } else if (message instanceof ReadyLocalTransaction) {
                 handleReadyLocalTransaction((ReadyLocalTransaction)message);
-            } else if (CanCommitTransaction.SERIALIZABLE_CLASS.isInstance(message)) {
+            } else if (CanCommitTransaction.isSerializedType(message)) {
                 handleCanCommitTransaction(CanCommitTransaction.fromSerializable(message));
-            } else if (CommitTransaction.SERIALIZABLE_CLASS.isInstance(message)) {
+            } else if (CommitTransaction.isSerializedType(message)) {
                 handleCommitTransaction(CommitTransaction.fromSerializable(message));
-            } else if (AbortTransaction.SERIALIZABLE_CLASS.isInstance(message)) {
+            } else if (AbortTransaction.isSerializedType(message)) {
                 handleAbortTransaction(AbortTransaction.fromSerializable(message));
             } else if (CloseTransactionChain.SERIALIZABLE_CLASS.isInstance(message)) {
                 closeTransactionChain(CloseTransactionChain.fromSerializable(message));
@@ -347,7 +347,7 @@ public class Shard extends RaftActor {
         try {
             cohortEntry.commit();
 
-            sender.tell(CommitTransactionReply.INSTANCE.toSerializable(), getSelf());
+            sender.tell(CommitTransactionReply.instance(DataStoreVersions.CURRENT_VERSION).toSerializable(), getSelf());
 
             shardMBean.incrementCommittedTransactionCount();
             shardMBean.setLastCommittedTransactionTime(System.currentTimeMillis());
@@ -384,7 +384,7 @@ public class Shard extends RaftActor {
                     LOG.error("{}: Failed to re-apply transaction {}", persistenceId(), transactionID, e);
                 }
 
-                sender.tell(CommitTransactionReply.INSTANCE.toSerializable(), getSelf());
+                sender.tell(CommitTransactionReply.instance(DataStoreVersions.CURRENT_VERSION).toSerializable(), getSelf());
             } else {
                 // This really shouldn't happen - it likely means that persistence or replication
                 // took so long to complete such that the cohort entry was expired from the cache.
index 38bf34f..0c6012b 100644 (file)
@@ -319,9 +319,10 @@ class ShardCommitCoordinator {
                                 "Can Commit failed, no detailed cause available.")), cohortEntry.getShard().self());
                 }
             } else {
+                // FIXME - use caller's version
                 cohortEntry.getReplySender().tell(
-                        canCommit ? CanCommitTransactionReply.YES.toSerializable() :
-                            CanCommitTransactionReply.NO.toSerializable(), cohortEntry.getShard().self());
+                        canCommit ? CanCommitTransactionReply.yes(DataStoreVersions.CURRENT_VERSION).toSerializable() :
+                            CanCommitTransactionReply.no(DataStoreVersions.CURRENT_VERSION).toSerializable(), cohortEntry.getShard().self());
             }
         } catch (Exception e) {
             log.debug("{}: An exception occurred during canCommit", name, e);
index 09b6568..1e59f0d 100644 (file)
@@ -116,7 +116,7 @@ public class ThreePhaseCommitCohortProxy extends AbstractThreePhaseCommitCohort<
 
         commitOperationCallback.run();
 
-        final Object message = new CanCommitTransaction(transactionId).toSerializable();
+        final Object message = new CanCommitTransaction(transactionId, DataStoreVersions.CURRENT_VERSION).toSerializable();
 
         final Iterator<ActorSelection> iterator = cohorts.iterator();
 
@@ -137,7 +137,7 @@ public class ThreePhaseCommitCohortProxy extends AbstractThreePhaseCommitCohort<
                 commitOperationCallback.pause();
 
                 boolean result = true;
-                if (response.getClass().equals(CanCommitTransactionReply.SERIALIZABLE_CLASS)) {
+                if (CanCommitTransactionReply.isSerializedType(response)) {
                     CanCommitTransactionReply reply =
                             CanCommitTransactionReply.fromSerializable(response);
                     if (!reply.getCanCommit()) {
@@ -196,8 +196,8 @@ public class ThreePhaseCommitCohortProxy extends AbstractThreePhaseCommitCohort<
         // exception then that exception will supersede and suppress the original exception. But
         // it's the original exception that is the root cause and of more interest to the client.
 
-        return voidOperation("abort", new AbortTransaction(transactionId).toSerializable(),
-                AbortTransactionReply.SERIALIZABLE_CLASS, false);
+        return voidOperation("abort", new AbortTransaction(transactionId, DataStoreVersions.CURRENT_VERSION).toSerializable(),
+                AbortTransactionReply.class, false);
     }
 
     @Override
@@ -205,8 +205,8 @@ public class ThreePhaseCommitCohortProxy extends AbstractThreePhaseCommitCohort<
         OperationCallback operationCallback = commitOperationCallback != null ? commitOperationCallback :
             OperationCallback.NO_OP_CALLBACK;
 
-        return voidOperation("commit", new CommitTransaction(transactionId).toSerializable(),
-                CommitTransactionReply.SERIALIZABLE_CLASS, true, operationCallback);
+        return voidOperation("commit", new CommitTransaction(transactionId, DataStoreVersions.CURRENT_VERSION).toSerializable(),
+                CommitTransactionReply.class, true, operationCallback);
     }
 
     private ListenableFuture<Void> voidOperation(final String operationName, final Object message,
index 172849c..5118de4 100644 (file)
@@ -44,7 +44,7 @@ class EntityOwnershipShardCommitCoordinator {
 
     boolean handleMessage(Object message, EntityOwnershipShard shard) {
         boolean handled = true;
-        if(CommitTransactionReply.SERIALIZABLE_CLASS.isInstance(message)) {
+        if(CommitTransactionReply.isSerializedType(message)) {
             // Successful reply from a local commit.
             inflightCommitSucceeded(shard);
         } else if(message instanceof akka.actor.Status.Failure) {
index d24e29c..e70ced8 100644 (file)
@@ -8,30 +8,36 @@
 
 package org.opendaylight.controller.cluster.datastore.messages;
 
+import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
 import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
 
-public class AbortTransaction implements SerializableMessage {
-    public static final Class<ThreePhaseCommitCohortMessages.AbortTransaction> SERIALIZABLE_CLASS =
-            ThreePhaseCommitCohortMessages.AbortTransaction.class;
+public class AbortTransaction extends AbstractThreePhaseCommitMessage {
+    private static final long serialVersionUID = 1L;
 
-    private final String transactionID;
-
-    public AbortTransaction(String transactionID) {
-        this.transactionID = transactionID;
+    public AbortTransaction() {
     }
 
-    public String getTransactionID() {
-        return transactionID;
+    public AbortTransaction(String transactionID, final short version) {
+        super(transactionID, version);
     }
 
     @Override
-    public Object toSerializable() {
+    protected Object newLegacySerializedInstance() {
         return ThreePhaseCommitCohortMessages.AbortTransaction.newBuilder().
-                setTransactionId(transactionID).build();
+                setTransactionId(getTransactionID()).build();
+    }
+
+    public static AbortTransaction fromSerializable(Object serializable) {
+        if(serializable instanceof AbortTransaction) {
+            return (AbortTransaction)serializable;
+        } else {
+            return new AbortTransaction(((ThreePhaseCommitCohortMessages.AbortTransaction)serializable).
+                    getTransactionId(), DataStoreVersions.LITHIUM_VERSION);
+        }
     }
 
-    public static AbortTransaction fromSerializable(Object message) {
-        return new AbortTransaction(((ThreePhaseCommitCohortMessages.AbortTransaction)message).
-                getTransactionId());
+    public static boolean isSerializedType(Object message) {
+        return message instanceof AbortTransaction ||
+                message instanceof ThreePhaseCommitCohortMessages.AbortTransaction;
     }
 }
index 3680aec..b2c9ea5 100644 (file)
@@ -8,19 +8,33 @@
 
 package org.opendaylight.controller.cluster.datastore.messages;
 
+import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
 import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
 
-public class AbortTransactionReply implements SerializableMessage {
-    public static final Class<ThreePhaseCommitCohortMessages.AbortTransactionReply> SERIALIZABLE_CLASS =
-            ThreePhaseCommitCohortMessages.AbortTransactionReply.class;
-
+public class AbortTransactionReply extends EmptyReply {
     private static final Object SERIALIZED_INSTANCE =
             ThreePhaseCommitCohortMessages.AbortTransactionReply.newBuilder().build();
 
-    public static final AbortTransactionReply INSTANCE = new AbortTransactionReply();
+    private static final AbortTransactionReply INSTANCE = new AbortTransactionReply();
+
+    public AbortTransactionReply() {
+    }
+
+    private AbortTransactionReply(short version) {
+        super(version);
+    }
 
     @Override
-    public Object toSerializable() {
+    protected Object newLegacySerializedInstance() {
         return SERIALIZED_INSTANCE;
     }
+
+    public static AbortTransactionReply instance(short version) {
+        return version == DataStoreVersions.CURRENT_VERSION ? INSTANCE : new AbortTransactionReply(version);
+    }
+
+    public static boolean isSerializedType(Object message) {
+        return message instanceof AbortTransactionReply ||
+                message instanceof ThreePhaseCommitCohortMessages.AbortTransactionReply;
+    }
 }
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/AbstractThreePhaseCommitMessage.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/AbstractThreePhaseCommitMessage.java
new file mode 100644 (file)
index 0000000..d96be31
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+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;
+
+/**
+ * Base class for a 3PC message.
+ *
+ * @author Thomas Pantelis
+ */
+public abstract class AbstractThreePhaseCommitMessage extends VersionedExternalizableMessage {
+    private static final long serialVersionUID = 1L;
+
+    private String transactionID;
+
+    protected AbstractThreePhaseCommitMessage() {
+    }
+
+    protected AbstractThreePhaseCommitMessage(final String transactionID, final short version) {
+        super(version);
+        this.transactionID = Preconditions.checkNotNull(transactionID);
+    }
+
+    protected abstract Object newLegacySerializedInstance();
+
+    public String getTransactionID() {
+        return transactionID;
+    }
+
+    @Override
+    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+        super.readExternal(in);
+        transactionID = in.readUTF();
+    }
+
+    @Override
+    public void writeExternal(ObjectOutput out) throws IOException {
+        super.writeExternal(out);
+        out.writeUTF(transactionID);
+    }
+
+    @Override
+    public Object toSerializable() {
+        return getVersion() >= DataStoreVersions.BORON_VERSION ? this : newLegacySerializedInstance();
+    }
+
+    @Override
+    public String toString() {
+        return getClass().getSimpleName() + " [transactionID=" + transactionID + ", version=" + getVersion()
+                + "]";
+    }
+}
index 565345a..4aff686 100644 (file)
@@ -8,29 +8,36 @@
 
 package org.opendaylight.controller.cluster.datastore.messages;
 
+import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
 import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
 
-public class CanCommitTransaction implements SerializableMessage {
-    public static final Class<?> SERIALIZABLE_CLASS = ThreePhaseCommitCohortMessages.CanCommitTransaction.class;
+public class CanCommitTransaction extends AbstractThreePhaseCommitMessage {
+    private static final long serialVersionUID = 1L;
 
-    private final String transactionID;
-
-    public CanCommitTransaction(String transactionID) {
-        this.transactionID = transactionID;
+    public CanCommitTransaction() {
     }
 
-    public String getTransactionID() {
-        return transactionID;
+    public CanCommitTransaction(String transactionID, final short version) {
+        super(transactionID, version);
     }
 
     @Override
-    public Object toSerializable() {
+    protected Object newLegacySerializedInstance() {
         return ThreePhaseCommitCohortMessages.CanCommitTransaction.newBuilder().
-                setTransactionId(transactionID).build();
+                setTransactionId(getTransactionID()).build();
+    }
+
+    public static CanCommitTransaction fromSerializable(Object serializable) {
+        if(serializable instanceof CanCommitTransaction) {
+            return (CanCommitTransaction)serializable;
+        } else {
+            return new CanCommitTransaction(((ThreePhaseCommitCohortMessages.CanCommitTransaction)serializable).
+                    getTransactionId(), DataStoreVersions.LITHIUM_VERSION);
+        }
     }
 
-    public static CanCommitTransaction fromSerializable(Object message) {
-        return new CanCommitTransaction(((ThreePhaseCommitCohortMessages.CanCommitTransaction)message).
-                getTransactionId());
+    public static boolean isSerializedType(Object message) {
+        return message instanceof CanCommitTransaction ||
+                message instanceof ThreePhaseCommitCohortMessages.CanCommitTransaction;
     }
 }
index 7e8cd43..fa4fca5 100644 (file)
@@ -8,14 +8,17 @@
 
 package org.opendaylight.controller.cluster.datastore.messages;
 
+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 implements SerializableMessage {
-    public static final Class<ThreePhaseCommitCohortMessages.CanCommitTransactionReply> SERIALIZABLE_CLASS =
-            ThreePhaseCommitCohortMessages.CanCommitTransactionReply.class;
-
-    public static final CanCommitTransactionReply YES = new CanCommitTransactionReply(true);
-    public static final CanCommitTransactionReply NO = new CanCommitTransactionReply(false);
+public class CanCommitTransactionReply extends VersionedExternalizableMessage {
+    private static final CanCommitTransactionReply YES =
+            new CanCommitTransactionReply(true, DataStoreVersions.CURRENT_VERSION);
+    private static final CanCommitTransactionReply NO =
+            new CanCommitTransactionReply(false, DataStoreVersions.CURRENT_VERSION);
 
     private static final ThreePhaseCommitCohortMessages.CanCommitTransactionReply YES_SERIALIZED =
             ThreePhaseCommitCohortMessages.CanCommitTransactionReply.newBuilder().setCanCommit(true).build();
@@ -23,9 +26,13 @@ public class CanCommitTransactionReply implements SerializableMessage {
     private static final ThreePhaseCommitCohortMessages.CanCommitTransactionReply NO_SERIALIZED =
             ThreePhaseCommitCohortMessages.CanCommitTransactionReply.newBuilder().setCanCommit(false).build();
 
-    private final boolean canCommit;
+    private boolean canCommit;
+
+    public CanCommitTransactionReply() {
+    }
 
-    private CanCommitTransactionReply(final boolean canCommit) {
+    private CanCommitTransactionReply(final boolean canCommit, final short version) {
+        super(version);
         this.canCommit = canCommit;
     }
 
@@ -33,14 +40,52 @@ public class CanCommitTransactionReply implements SerializableMessage {
         return canCommit;
     }
 
+    @Override
+    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+        super.readExternal(in);
+        canCommit = in.readBoolean();
+    }
+
+    @Override
+    public void writeExternal(ObjectOutput out) throws IOException {
+        super.writeExternal(out);
+        out.writeBoolean(canCommit);
+    }
+
     @Override
     public Object toSerializable() {
-        return canCommit ? YES_SERIALIZED : NO_SERIALIZED;
+        if(getVersion() >= DataStoreVersions.BORON_VERSION) {
+            return this;
+        } else {
+            return canCommit ? YES_SERIALIZED : NO_SERIALIZED;
+        }
+    }
+
+    @Override
+    public String toString() {
+        return "CanCommitTransactionReply [canCommit=" + canCommit + ", version=" + getVersion() + "]";
+    }
+
+    public static CanCommitTransactionReply yes(short version) {
+        return version == DataStoreVersions.CURRENT_VERSION ? YES : new CanCommitTransactionReply(true, version);
+    }
+
+    public static CanCommitTransactionReply no(short version) {
+        return version == DataStoreVersions.CURRENT_VERSION ? NO : new CanCommitTransactionReply(false, version);
+    }
+
+    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;
+        }
     }
 
-    public static CanCommitTransactionReply fromSerializable(final Object message) {
-        ThreePhaseCommitCohortMessages.CanCommitTransactionReply serialized =
-                (ThreePhaseCommitCohortMessages.CanCommitTransactionReply) message;
-        return serialized.getCanCommit() ? YES : NO;
+    public static boolean isSerializedType(Object message) {
+        return message instanceof CanCommitTransactionReply ||
+                message instanceof ThreePhaseCommitCohortMessages.CanCommitTransactionReply;
     }
 }
index d607fe5..495a00a 100644 (file)
@@ -8,30 +8,36 @@
 
 package org.opendaylight.controller.cluster.datastore.messages;
 
+import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
 import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
 
-public class CommitTransaction implements SerializableMessage {
-    public static final Class<ThreePhaseCommitCohortMessages.CommitTransaction> SERIALIZABLE_CLASS =
-            ThreePhaseCommitCohortMessages.CommitTransaction.class;
+public class CommitTransaction extends AbstractThreePhaseCommitMessage {
+    private static final long serialVersionUID = 1L;
 
-    private final String transactionID;
-
-    public CommitTransaction(String transactionID) {
-        this.transactionID = transactionID;
+    public CommitTransaction() {
     }
 
-    public String getTransactionID() {
-        return transactionID;
+    public CommitTransaction(String transactionID, final short version) {
+        super(transactionID, version);
     }
 
     @Override
-    public Object toSerializable() {
+    protected Object newLegacySerializedInstance() {
         return ThreePhaseCommitCohortMessages.CommitTransaction.newBuilder().setTransactionId(
-                transactionID).build();
+                getTransactionID()).build();
+    }
+
+    public static CommitTransaction fromSerializable(Object serializable) {
+        if(serializable instanceof CommitTransaction) {
+            return (CommitTransaction)serializable;
+        } else {
+            return new CommitTransaction(((ThreePhaseCommitCohortMessages.CommitTransaction)serializable).
+                    getTransactionId(), DataStoreVersions.LITHIUM_VERSION);
+        }
     }
 
-    public static CommitTransaction fromSerializable(Object message) {
-        return new CommitTransaction(((ThreePhaseCommitCohortMessages.
-                CommitTransaction)message).getTransactionId());
+    public static boolean isSerializedType(Object message) {
+        return message instanceof CommitTransaction ||
+                message instanceof ThreePhaseCommitCohortMessages.CommitTransaction;
     }
 }
index 47adea5..2b800c8 100644 (file)
@@ -8,19 +8,33 @@
 
 package org.opendaylight.controller.cluster.datastore.messages;
 
+import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
 import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
 
-public class CommitTransactionReply implements SerializableMessage {
-    public static final Class<ThreePhaseCommitCohortMessages.CommitTransactionReply> SERIALIZABLE_CLASS =
-            ThreePhaseCommitCohortMessages.CommitTransactionReply.class;
-
+public class CommitTransactionReply extends EmptyReply {
     private static final Object SERIALIZED_INSTANCE =
             ThreePhaseCommitCohortMessages.CommitTransactionReply.newBuilder().build();
 
     public static final CommitTransactionReply INSTANCE = new CommitTransactionReply();
 
+    public CommitTransactionReply() {
+    }
+
+    private CommitTransactionReply(short version) {
+        super(version);
+    }
+
     @Override
-    public Object toSerializable() {
+    protected Object newLegacySerializedInstance() {
         return SERIALIZED_INSTANCE;
     }
+
+    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 ||
+                message instanceof ThreePhaseCommitCohortMessages.CommitTransactionReply;
+    }
 }
index 38a37f0..7eea727 100644 (file)
@@ -14,16 +14,23 @@ import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
  *
  * @author Thomas Pantelis
  */
-public abstract class EmptyReply extends EmptyExternalizable {
+public abstract class EmptyReply extends VersionedExternalizableMessage {
+    protected EmptyReply() {
+    }
+
+    protected EmptyReply(short version) {
+        super(version);
+    }
 
-    private final Object legacySerializedInstance;
+    protected abstract Object newLegacySerializedInstance();
 
-    protected EmptyReply(Object legacySerializedInstance) {
-        super();
-        this.legacySerializedInstance = legacySerializedInstance;
+    @Override
+    public Object toSerializable() {
+        return getVersion() >= DataStoreVersions.BORON_VERSION ? this : newLegacySerializedInstance();
     }
 
-    public Object toSerializable(short toVersion) {
-        return toVersion >= DataStoreVersions.LITHIUM_VERSION ? this : legacySerializedInstance;
+    @Override
+    public String toString() {
+        return getClass().getSimpleName() + " [version=" + getVersion() + "]";
     }
 }
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/PreCommitTransaction.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/PreCommitTransaction.java
deleted file mode 100644 (file)
index 3cec7e7..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.cluster.datastore.messages;
-
-import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
-
-public class PreCommitTransaction implements SerializableMessage{
-
-  public static final Class<ThreePhaseCommitCohortMessages.PreCommitTransaction> SERIALIZABLE_CLASS =
-          ThreePhaseCommitCohortMessages.PreCommitTransaction.class;
-
-  @Override
-  public Object toSerializable() {
-    return  ThreePhaseCommitCohortMessages.PreCommitTransaction.newBuilder().build();
-  }
-}
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/PreCommitTransactionReply.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/PreCommitTransactionReply.java
deleted file mode 100644 (file)
index d158049..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.cluster.datastore.messages;
-
-import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
-
-public class PreCommitTransactionReply implements SerializableMessage{
-
-  public static final Class<ThreePhaseCommitCohortMessages.PreCommitTransactionReply> SERIALIZABLE_CLASS =
-          ThreePhaseCommitCohortMessages.PreCommitTransactionReply.class;
-
-  @Override
-  public Object toSerializable() {
-    return  ThreePhaseCommitCohortMessages.PreCommitTransactionReply.newBuilder().build();
-  }
-}
index cf5bff0..e502c0d 100644 (file)
@@ -456,8 +456,8 @@ public abstract class AbstractTransactionProxyTest {
                 Iterator<?> iter = futureResults.iterator();
                 while(iter.hasNext()) {
                     Object actual = iter.next();
-                    if(CommitTransactionReply.SERIALIZABLE_CLASS.isInstance(expReply) &&
-                       CommitTransactionReply.SERIALIZABLE_CLASS.isInstance(actual)) {
+                    if(CommitTransactionReply.isSerializedType(expReply) &&
+                       CommitTransactionReply.isSerializedType(actual)) {
                         found = true;
                     } else if(expReply instanceof ActorSelection && Objects.equal(expReply, actual)) {
                         found = true;
index 492a72b..499d5e2 100644 (file)
@@ -568,7 +568,7 @@ public class DistributedDataStoreRemotingIntegrationTest {
             throw new AssertionError("Unexpected failure response", ((akka.actor.Status.Failure)resp).cause());
         }
 
-        assertEquals("Response type", CommitTransactionReply.SERIALIZABLE_CLASS, resp.getClass());
+        assertEquals("Response type", CommitTransactionReply.class, resp.getClass());
 
         verifyCars(leaderDistributedDataStore.newReadOnlyTransaction(), car1);
 
@@ -631,7 +631,7 @@ public class DistributedDataStoreRemotingIntegrationTest {
             throw new AssertionError("Unexpected failure response", ((akka.actor.Status.Failure)resp).cause());
         }
 
-        assertEquals("Response type", CommitTransactionReply.SERIALIZABLE_CLASS, resp.getClass());
+        assertEquals("Response type", CommitTransactionReply.class, resp.getClass());
 
         verifyCars(leaderDistributedDataStore.newReadOnlyTransaction(), car1);
 
index 83dae88..c31acda 100644 (file)
@@ -98,7 +98,6 @@ import org.opendaylight.controller.md.cluster.datastore.model.SchemaContextHelpe
 import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
@@ -560,9 +559,9 @@ public class ShardTest extends AbstractShardTest {
 
             // Send the CanCommitTransaction message for the first Tx.
 
-            shard.tell(new CanCommitTransaction(transactionID1).toSerializable(), getRef());
+            shard.tell(new CanCommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), getRef());
             final CanCommitTransactionReply canCommitReply = CanCommitTransactionReply.fromSerializable(
-                    expectMsgClass(duration, CanCommitTransactionReply.SERIALIZABLE_CLASS));
+                    expectMsgClass(duration, CanCommitTransactionReply.class));
             assertEquals("Can commit", true, canCommitReply.getCanCommit());
 
             shard.tell(prepareReadyTransactionMessage(false, shard.underlyingActor(), cohort2, transactionID2, modification2), getRef());
@@ -575,16 +574,16 @@ public class ShardTest extends AbstractShardTest {
             // processed after the first Tx completes.
 
             final Future<Object> canCommitFuture1 = Patterns.ask(shard,
-                    new CanCommitTransaction(transactionID2).toSerializable(), timeout);
+                    new CanCommitTransaction(transactionID2, CURRENT_VERSION).toSerializable(), timeout);
 
             final Future<Object> canCommitFuture2 = Patterns.ask(shard,
-                    new CanCommitTransaction(transactionID3).toSerializable(), timeout);
+                    new CanCommitTransaction(transactionID3, CURRENT_VERSION).toSerializable(), timeout);
 
             // Send the CommitTransaction message for the first Tx. After it completes, it should
             // trigger the 2nd Tx to proceed which should in turn then trigger the 3rd.
 
-            shard.tell(new CommitTransaction(transactionID1).toSerializable(), getRef());
-            expectMsgClass(duration, CommitTransactionReply.SERIALIZABLE_CLASS);
+            shard.tell(new CommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), getRef());
+            expectMsgClass(duration, CommitTransactionReply.class);
 
             // Wait for the next 2 Tx's to complete.
 
@@ -618,7 +617,7 @@ public class ShardTest extends AbstractShardTest {
 
             class OnCommitFutureComplete extends OnFutureComplete {
                 OnCommitFutureComplete() {
-                    super(CommitTransactionReply.SERIALIZABLE_CLASS);
+                    super(CommitTransactionReply.class);
                 }
 
                 @Override
@@ -632,7 +631,7 @@ public class ShardTest extends AbstractShardTest {
                 private final String transactionID;
 
                 OnCanCommitFutureComplete(final String transactionID) {
-                    super(CanCommitTransactionReply.SERIALIZABLE_CLASS);
+                    super(CanCommitTransactionReply.class);
                     this.transactionID = transactionID;
                 }
 
@@ -643,7 +642,7 @@ public class ShardTest extends AbstractShardTest {
                     assertEquals("Can commit", true, canCommitReply.getCanCommit());
 
                     final Future<Object> commitFuture = Patterns.ask(shard,
-                            new CommitTransaction(transactionID).toSerializable(), timeout);
+                            new CommitTransaction(transactionID, CURRENT_VERSION).toSerializable(), timeout);
                     commitFuture.onComplete(new OnCommitFutureComplete(), getSystem().dispatcher());
                 }
             }
@@ -726,15 +725,15 @@ public class ShardTest extends AbstractShardTest {
 
             // Send the CanCommitTransaction message.
 
-            shard.tell(new CanCommitTransaction(transactionID).toSerializable(), getRef());
+            shard.tell(new CanCommitTransaction(transactionID, CURRENT_VERSION).toSerializable(), getRef());
             final CanCommitTransactionReply canCommitReply = CanCommitTransactionReply.fromSerializable(
-                    expectMsgClass(duration, CanCommitTransactionReply.SERIALIZABLE_CLASS));
+                    expectMsgClass(duration, CanCommitTransactionReply.class));
             assertEquals("Can commit", true, canCommitReply.getCanCommit());
 
             // Send the CanCommitTransaction message.
 
-            shard.tell(new CommitTransaction(transactionID).toSerializable(), getRef());
-            expectMsgClass(duration, CommitTransactionReply.SERIALIZABLE_CLASS);
+            shard.tell(new CommitTransaction(transactionID, CURRENT_VERSION).toSerializable(), getRef());
+            expectMsgClass(duration, CommitTransactionReply.class);
 
             final InOrder inOrder = inOrder(mockCohort.get());
             inOrder.verify(mockCohort.get()).canCommit();
@@ -789,7 +788,7 @@ public class ShardTest extends AbstractShardTest {
                     TestModel.OUTER_LIST_PATH).nodeWithKey(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 1).build(),
                 ImmutableNodes.mapEntry(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 1), true, true, 3), getRef());
 
-            expectMsgClass(duration, CommitTransactionReply.SERIALIZABLE_CLASS);
+            expectMsgClass(duration, CommitTransactionReply.class);
 
             final InOrder inOrder = inOrder(mockCohort.get());
             inOrder.verify(mockCohort.get()).canCommit();
@@ -899,13 +898,13 @@ public class ShardTest extends AbstractShardTest {
 
             // Commit the write transaction.
 
-            shard.tell(new CanCommitTransaction(transactionID1).toSerializable(), getRef());
+            shard.tell(new CanCommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), getRef());
             final CanCommitTransactionReply canCommitReply = CanCommitTransactionReply.fromSerializable(
-                    expectMsgClass(duration, CanCommitTransactionReply.SERIALIZABLE_CLASS));
+                    expectMsgClass(duration, CanCommitTransactionReply.class));
             assertEquals("Can commit", true, canCommitReply.getCanCommit());
 
-            shard.tell(new CommitTransaction(transactionID1).toSerializable(), getRef());
-            expectMsgClass(duration, CommitTransactionReply.SERIALIZABLE_CLASS);
+            shard.tell(new CommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), getRef());
+            expectMsgClass(duration, CommitTransactionReply.class);
 
             // Verify data in the data store.
 
@@ -1005,7 +1004,7 @@ public class ShardTest extends AbstractShardTest {
 
             shard.tell(prepareReadyTransactionMessage(readWrite, shard.underlyingActor(), cohort, transactionID, modification, true), getRef());
 
-            expectMsgClass(duration, ThreePhaseCommitCohortMessages.CommitTransactionReply.class);
+            expectMsgClass(duration, CommitTransactionReply.class);
 
             final InOrder inOrder = inOrder(cohort);
             inOrder.verify(cohort).canCommit();
@@ -1041,7 +1040,7 @@ public class ShardTest extends AbstractShardTest {
 
             shard.tell(readyMessage, getRef());
 
-            expectMsgClass(CommitTransactionReply.SERIALIZABLE_CLASS);
+            expectMsgClass(CommitTransactionReply.class);
 
             final NormalizedNode<?, ?> actualNode = readStore(shard, TestModel.OUTER_LIST_PATH);
             assertEquals(TestModel.OUTER_LIST_QNAME.getLocalName(), mergeData, actualNode);
@@ -1076,15 +1075,15 @@ public class ShardTest extends AbstractShardTest {
 
             // Send the CanCommitTransaction message.
 
-            shard.tell(new CanCommitTransaction(txId).toSerializable(), getRef());
+            shard.tell(new CanCommitTransaction(txId, CURRENT_VERSION).toSerializable(), getRef());
             final CanCommitTransactionReply canCommitReply = CanCommitTransactionReply.fromSerializable(
-                    expectMsgClass(CanCommitTransactionReply.SERIALIZABLE_CLASS));
+                    expectMsgClass(CanCommitTransactionReply.class));
             assertEquals("Can commit", true, canCommitReply.getCanCommit());
 
             // Send the CanCommitTransaction message.
 
-            shard.tell(new CommitTransaction(txId).toSerializable(), getRef());
-            expectMsgClass(CommitTransactionReply.SERIALIZABLE_CLASS);
+            shard.tell(new CommitTransaction(txId, CURRENT_VERSION).toSerializable(), getRef());
+            expectMsgClass(CommitTransactionReply.class);
 
             final NormalizedNode<?, ?> actualNode = readStore(shard, TestModel.OUTER_LIST_PATH);
             assertEquals(TestModel.OUTER_LIST_QNAME.getLocalName(), mergeData, actualNode);
@@ -1123,15 +1122,15 @@ public class ShardTest extends AbstractShardTest {
 
             // Send the CanCommitTransaction message.
 
-            shard.tell(new CanCommitTransaction(transactionID).toSerializable(), getRef());
+            shard.tell(new CanCommitTransaction(transactionID, CURRENT_VERSION).toSerializable(), getRef());
             final CanCommitTransactionReply canCommitReply = CanCommitTransactionReply.fromSerializable(
-                    expectMsgClass(duration, CanCommitTransactionReply.SERIALIZABLE_CLASS));
+                    expectMsgClass(duration, CanCommitTransactionReply.class));
             assertEquals("Can commit", true, canCommitReply.getCanCommit());
 
             // Send the CanCommitTransaction message.
 
-            shard.tell(new CommitTransaction(transactionID).toSerializable(), getRef());
-            expectMsgClass(duration, CommitTransactionReply.SERIALIZABLE_CLASS);
+            shard.tell(new CommitTransaction(transactionID, CURRENT_VERSION).toSerializable(), getRef());
+            expectMsgClass(duration, CommitTransactionReply.class);
 
             final InOrder inOrder = inOrder(cohort);
             inOrder.verify(cohort).canCommit();
@@ -1175,13 +1174,13 @@ public class ShardTest extends AbstractShardTest {
 
                 // Send the CanCommitTransaction message.
 
-                shard.tell(new CanCommitTransaction(transactionID).toSerializable(), getRef());
+                shard.tell(new CanCommitTransaction(transactionID, CURRENT_VERSION).toSerializable(), getRef());
                 final CanCommitTransactionReply canCommitReply = CanCommitTransactionReply.fromSerializable(
-                        expectMsgClass(duration, CanCommitTransactionReply.SERIALIZABLE_CLASS));
+                        expectMsgClass(duration, CanCommitTransactionReply.class));
                 assertEquals("Can commit", true, canCommitReply.getCanCommit());
 
-                shard.tell(new CommitTransaction(transactionID).toSerializable(), getRef());
-                expectMsgClass(duration, ThreePhaseCommitCohortMessages.CommitTransactionReply.class);
+                shard.tell(new CommitTransaction(transactionID, CURRENT_VERSION).toSerializable(), getRef());
+                expectMsgClass(duration, CommitTransactionReply.class);
 
                 final InOrder inOrder = inOrder(cohort);
                 inOrder.verify(cohort).canCommit();
@@ -1232,13 +1231,13 @@ public class ShardTest extends AbstractShardTest {
 
                 // Send the CanCommitTransaction message.
 
-                shard.tell(new CanCommitTransaction(transactionID).toSerializable(), getRef());
+                shard.tell(new CanCommitTransaction(transactionID, CURRENT_VERSION).toSerializable(), getRef());
                 final CanCommitTransactionReply canCommitReply = CanCommitTransactionReply.fromSerializable(
-                        expectMsgClass(duration, CanCommitTransactionReply.SERIALIZABLE_CLASS));
+                        expectMsgClass(duration, CanCommitTransactionReply.class));
                 assertEquals("Can commit", true, canCommitReply.getCanCommit());
 
-                shard.tell(new CommitTransaction(transactionID).toSerializable(), getRef());
-                expectMsgClass(duration, ThreePhaseCommitCohortMessages.CommitTransactionReply.class);
+                shard.tell(new CommitTransaction(transactionID, CURRENT_VERSION).toSerializable(), getRef());
+                expectMsgClass(duration, CommitTransactionReply.class);
 
                 final InOrder inOrder = inOrder(cohort);
                 inOrder.verify(cohort).canCommit();
@@ -1299,21 +1298,21 @@ public class ShardTest extends AbstractShardTest {
 
             // Send the CanCommitTransaction message for the first Tx.
 
-            shard.tell(new CanCommitTransaction(transactionID1).toSerializable(), getRef());
+            shard.tell(new CanCommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), getRef());
             final CanCommitTransactionReply canCommitReply = CanCommitTransactionReply.fromSerializable(
-                    expectMsgClass(duration, CanCommitTransactionReply.SERIALIZABLE_CLASS));
+                    expectMsgClass(duration, CanCommitTransactionReply.class));
             assertEquals("Can commit", true, canCommitReply.getCanCommit());
 
             // Send the CanCommitTransaction message for the 2nd Tx. This should get queued and
             // processed after the first Tx completes.
 
             final Future<Object> canCommitFuture = Patterns.ask(shard,
-                    new CanCommitTransaction(transactionID2).toSerializable(), timeout);
+                    new CanCommitTransaction(transactionID2, CURRENT_VERSION).toSerializable(), timeout);
 
             // Send the CommitTransaction message for the first Tx. This should send back an error
             // and trigger the 2nd Tx to proceed.
 
-            shard.tell(new CommitTransaction(transactionID1).toSerializable(), getRef());
+            shard.tell(new CommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), getRef());
             expectMsgClass(duration, akka.actor.Status.Failure.class);
 
             // Wait for the 2nd Tx to complete the canCommit phase.
@@ -1372,21 +1371,21 @@ public class ShardTest extends AbstractShardTest {
 
             // Send the CanCommitTransaction message for the first Tx.
 
-            shard.tell(new CanCommitTransaction(transactionID1).toSerializable(), getRef());
+            shard.tell(new CanCommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), getRef());
             final CanCommitTransactionReply canCommitReply = CanCommitTransactionReply.fromSerializable(
-                expectMsgClass(duration, CanCommitTransactionReply.SERIALIZABLE_CLASS));
+                expectMsgClass(duration, CanCommitTransactionReply.class));
             assertEquals("Can commit", true, canCommitReply.getCanCommit());
 
             // Send the CanCommitTransaction message for the 2nd Tx. This should get queued and
             // processed after the first Tx completes.
 
             final Future<Object> canCommitFuture = Patterns.ask(shard,
-                    new CanCommitTransaction(transactionID2).toSerializable(), timeout);
+                    new CanCommitTransaction(transactionID2, CURRENT_VERSION).toSerializable(), timeout);
 
             // Send the CommitTransaction message for the first Tx. This should send back an error
             // and trigger the 2nd Tx to proceed.
 
-            shard.tell(new CommitTransaction(transactionID1).toSerializable(), getRef());
+            shard.tell(new CommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), getRef());
             expectMsgClass(duration, akka.actor.Status.Failure.class);
 
             // Wait for the 2nd Tx to complete the canCommit phase.
@@ -1434,7 +1433,7 @@ public class ShardTest extends AbstractShardTest {
 
             // Send the CanCommitTransaction message.
 
-            shard.tell(new CanCommitTransaction(transactionID1).toSerializable(), getRef());
+            shard.tell(new CanCommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), getRef());
             expectMsgClass(duration, akka.actor.Status.Failure.class);
 
             // Send another can commit to ensure the failed one got cleaned up.
@@ -1447,9 +1446,9 @@ public class ShardTest extends AbstractShardTest {
             shard.tell(prepareReadyTransactionMessage(readWrite, shard.underlyingActor(), cohort, transactionID2, modification), getRef());
             expectMsgClass(duration, ReadyTransactionReply.class);
 
-            shard.tell(new CanCommitTransaction(transactionID2).toSerializable(), getRef());
+            shard.tell(new CanCommitTransaction(transactionID2, CURRENT_VERSION).toSerializable(), getRef());
             final CanCommitTransactionReply reply = CanCommitTransactionReply.fromSerializable(
-                    expectMsgClass(CanCommitTransactionReply.SERIALIZABLE_CLASS));
+                    expectMsgClass(CanCommitTransactionReply.class));
             assertEquals("getCanCommit", true, reply.getCanCommit());
         }};
     }
@@ -1480,9 +1479,9 @@ public class ShardTest extends AbstractShardTest {
 
             // Send the CanCommitTransaction message.
 
-            shard.tell(new CanCommitTransaction(transactionID1).toSerializable(), getRef());
+            shard.tell(new CanCommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), getRef());
             CanCommitTransactionReply reply = CanCommitTransactionReply.fromSerializable(
-                    expectMsgClass(CanCommitTransactionReply.SERIALIZABLE_CLASS));
+                    expectMsgClass(CanCommitTransactionReply.class));
             assertEquals("getCanCommit", false, reply.getCanCommit());
 
             // Send another can commit to ensure the failed one got cleaned up.
@@ -1495,9 +1494,9 @@ public class ShardTest extends AbstractShardTest {
             shard.tell(prepareReadyTransactionMessage(readWrite, shard.underlyingActor(), cohort, transactionID2, modification), getRef());
             expectMsgClass(duration, ReadyTransactionReply.class);
 
-            shard.tell(new CanCommitTransaction(transactionID2).toSerializable(), getRef());
+            shard.tell(new CanCommitTransaction(transactionID2, CURRENT_VERSION).toSerializable(), getRef());
             reply = CanCommitTransactionReply.fromSerializable(
-                    expectMsgClass(CanCommitTransactionReply.SERIALIZABLE_CLASS));
+                    expectMsgClass(CanCommitTransactionReply.class));
             assertEquals("getCanCommit", true, reply.getCanCommit());
         }};
     }
@@ -1543,7 +1542,7 @@ public class ShardTest extends AbstractShardTest {
 
             shard.tell(prepareReadyTransactionMessage(readWrite, shard.underlyingActor(), cohort, transactionID2, modification, true), getRef());
 
-            expectMsgClass(duration, CommitTransactionReply.SERIALIZABLE_CLASS);
+            expectMsgClass(duration, CommitTransactionReply.class);
         }};
     }
 
@@ -1588,7 +1587,7 @@ public class ShardTest extends AbstractShardTest {
 
             shard.tell(prepareReadyTransactionMessage(readWrite, shard.underlyingActor(), cohort, transactionID2, modification, true), getRef());
 
-            expectMsgClass(duration, CommitTransactionReply.SERIALIZABLE_CLASS);
+            expectMsgClass(duration, CommitTransactionReply.class);
         }};
     }
 
@@ -1638,13 +1637,13 @@ public class ShardTest extends AbstractShardTest {
             shard.tell(prepareReadyTransactionMessage(readWrite, shard.underlyingActor(), cohort, transactionID, modification), getRef());
             expectMsgClass(duration, ReadyTransactionReply.class);
 
-            shard.tell(new CanCommitTransaction(transactionID).toSerializable(), getRef());
+            shard.tell(new CanCommitTransaction(transactionID, CURRENT_VERSION).toSerializable(), getRef());
             final CanCommitTransactionReply canCommitReply = CanCommitTransactionReply.fromSerializable(
-                expectMsgClass(duration, CanCommitTransactionReply.SERIALIZABLE_CLASS));
+                expectMsgClass(duration, CanCommitTransactionReply.class));
             assertEquals("Can commit", true, canCommitReply.getCanCommit());
 
-            shard.tell(new CommitTransaction(transactionID).toSerializable(), getRef());
-            expectMsgClass(duration, CommitTransactionReply.SERIALIZABLE_CLASS);
+            shard.tell(new CommitTransaction(transactionID, CURRENT_VERSION).toSerializable(), getRef());
+            expectMsgClass(duration, CommitTransactionReply.class);
 
             final NormalizedNode<?, ?> node = readStore(shard, TestModel.TEST_PATH);
 
@@ -1710,23 +1709,23 @@ public class ShardTest extends AbstractShardTest {
 
             // canCommit 1st Tx. We don't send the commit so it should timeout.
 
-            shard.tell(new CanCommitTransaction(transactionID1).toSerializable(), getRef());
-            expectMsgClass(duration, CanCommitTransactionReply.SERIALIZABLE_CLASS);
+            shard.tell(new CanCommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), getRef());
+            expectMsgClass(duration, CanCommitTransactionReply.class);
 
             // canCommit the 2nd Tx - it should complete after the 1st Tx times out.
 
-            shard.tell(new CanCommitTransaction(transactionID2).toSerializable(), getRef());
-            expectMsgClass(duration, CanCommitTransactionReply.SERIALIZABLE_CLASS);
+            shard.tell(new CanCommitTransaction(transactionID2, CURRENT_VERSION).toSerializable(), getRef());
+            expectMsgClass(duration, CanCommitTransactionReply.class);
 
             // Try to commit the 1st Tx - should fail as it's not the current Tx.
 
-            shard.tell(new CommitTransaction(transactionID1).toSerializable(), getRef());
+            shard.tell(new CommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), getRef());
             expectMsgClass(duration, akka.actor.Status.Failure.class);
 
             // Commit the 2nd Tx.
 
-            shard.tell(new CommitTransaction(transactionID2).toSerializable(), getRef());
-            expectMsgClass(duration, CommitTransactionReply.SERIALIZABLE_CLASS);
+            shard.tell(new CommitTransaction(transactionID2, CURRENT_VERSION).toSerializable(), getRef());
+            expectMsgClass(duration, CommitTransactionReply.class);
 
             final NormalizedNode<?, ?> node = readStore(shard, listNodePath);
             assertNotNull(listNodePath + " not found", node);
@@ -1780,16 +1779,16 @@ public class ShardTest extends AbstractShardTest {
 
             // canCommit 1st Tx.
 
-            shard.tell(new CanCommitTransaction(transactionID1).toSerializable(), getRef());
-            expectMsgClass(duration, CanCommitTransactionReply.SERIALIZABLE_CLASS);
+            shard.tell(new CanCommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), getRef());
+            expectMsgClass(duration, CanCommitTransactionReply.class);
 
             // canCommit the 2nd Tx - it should get queued.
 
-            shard.tell(new CanCommitTransaction(transactionID2).toSerializable(), getRef());
+            shard.tell(new CanCommitTransaction(transactionID2, CURRENT_VERSION).toSerializable(), getRef());
 
             // canCommit the 3rd Tx - should exceed queue capacity and fail.
 
-            shard.tell(new CanCommitTransaction(transactionID3).toSerializable(), getRef());
+            shard.tell(new CanCommitTransaction(transactionID3, CURRENT_VERSION).toSerializable(), getRef());
             expectMsgClass(duration, akka.actor.Status.Failure.class);
         }};
     }
@@ -1836,8 +1835,8 @@ public class ShardTest extends AbstractShardTest {
             // All Tx's are readied. We'll send canCommit for the last one but not the others. The others
             // should expire from the queue and the last one should be processed.
 
-            shard.tell(new CanCommitTransaction(transactionID3).toSerializable(), getRef());
-            expectMsgClass(duration, CanCommitTransactionReply.SERIALIZABLE_CLASS);
+            shard.tell(new CanCommitTransaction(transactionID3, CURRENT_VERSION).toSerializable(), getRef());
+            expectMsgClass(duration, CanCommitTransactionReply.class);
         }};
     }
 
@@ -1866,8 +1865,8 @@ public class ShardTest extends AbstractShardTest {
 
             // CanCommit the first one so it's the current in-progress CohortEntry.
 
-            shard.tell(new CanCommitTransaction(transactionID1).toSerializable(), getRef());
-            expectMsgClass(duration, CanCommitTransactionReply.SERIALIZABLE_CLASS);
+            shard.tell(new CanCommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), getRef());
+            expectMsgClass(duration, CanCommitTransactionReply.class);
 
             // Ready the second Tx.
 
@@ -1893,12 +1892,12 @@ public class ShardTest extends AbstractShardTest {
             // Commit the first Tx. After completing, the second should expire from the queue and the third
             // Tx committed.
 
-            shard.tell(new CommitTransaction(transactionID1).toSerializable(), getRef());
-            expectMsgClass(duration, CommitTransactionReply.SERIALIZABLE_CLASS);
+            shard.tell(new CommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), getRef());
+            expectMsgClass(duration, CommitTransactionReply.class);
 
             // Expect commit reply from the third Tx.
 
-            expectMsgClass(duration, CommitTransactionReply.SERIALIZABLE_CLASS);
+            expectMsgClass(duration, CommitTransactionReply.class);
 
             final NormalizedNode<?, ?> node = readStore(shard, TestModel.TEST2_PATH);
             assertNotNull(TestModel.TEST2_PATH + " not found", node);
@@ -1912,7 +1911,7 @@ public class ShardTest extends AbstractShardTest {
                     newShardProps().withDispatcher(Dispatchers.DefaultDispatcherId()),
                     "testCanCommitBeforeReadyFailure");
 
-            shard.tell(new CanCommitTransaction("tx").toSerializable(), getRef());
+            shard.tell(new CanCommitTransaction("tx", CURRENT_VERSION).toSerializable(), getRef());
             expectMsgClass(duration("5 seconds"), akka.actor.Status.Failure.class);
         }};
     }
@@ -1955,22 +1954,22 @@ public class ShardTest extends AbstractShardTest {
 
             // Send the CanCommitTransaction message for the first Tx.
 
-            shard.tell(new CanCommitTransaction(transactionID1).toSerializable(), getRef());
+            shard.tell(new CanCommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), getRef());
             final CanCommitTransactionReply canCommitReply = CanCommitTransactionReply.fromSerializable(
-                    expectMsgClass(duration, CanCommitTransactionReply.SERIALIZABLE_CLASS));
+                    expectMsgClass(duration, CanCommitTransactionReply.class));
             assertEquals("Can commit", true, canCommitReply.getCanCommit());
 
             // Send the CanCommitTransaction message for the 2nd Tx. This should get queued and
             // processed after the first Tx completes.
 
             final Future<Object> canCommitFuture = Patterns.ask(shard,
-                    new CanCommitTransaction(transactionID2).toSerializable(), timeout);
+                    new CanCommitTransaction(transactionID2, CURRENT_VERSION).toSerializable(), timeout);
 
             // Send the AbortTransaction message for the first Tx. This should trigger the 2nd
             // Tx to proceed.
 
-            shard.tell(new AbortTransaction(transactionID1).toSerializable(), getRef());
-            expectMsgClass(duration, AbortTransactionReply.SERIALIZABLE_CLASS);
+            shard.tell(new AbortTransaction(transactionID1, CURRENT_VERSION).toSerializable(), getRef());
+            expectMsgClass(duration, AbortTransactionReply.class);
 
             // Wait for the 2nd Tx to complete the canCommit phase.
 
@@ -2033,8 +2032,8 @@ public class ShardTest extends AbstractShardTest {
 
             // Send the AbortTransaction message.
 
-            shard.tell(new AbortTransaction(transactionID).toSerializable(), getRef());
-            expectMsgClass(duration, AbortTransactionReply.SERIALIZABLE_CLASS);
+            shard.tell(new AbortTransaction(transactionID, CURRENT_VERSION).toSerializable(), getRef());
+            expectMsgClass(duration, AbortTransactionReply.class);
 
             verify(cohort).abort();
 
@@ -2048,7 +2047,7 @@ public class ShardTest extends AbstractShardTest {
 
             // Now send CanCommitTransaction - should fail.
 
-            shard.tell(new CanCommitTransaction(transactionID).toSerializable(), getRef());
+            shard.tell(new CanCommitTransaction(transactionID, CURRENT_VERSION).toSerializable(), getRef());
 
             Throwable failure = expectMsgClass(duration, akka.actor.Status.Failure.class).cause();
             assertTrue("Failure type", failure instanceof IllegalStateException);
index 06e3a89..73c81fe 100644 (file)
@@ -281,7 +281,7 @@ public class ShardTransactionTest extends AbstractActorTest {
             batched.setTotalMessagesSent(1);
 
             transaction.tell(batched, getRef());
-            expectMsgClass(duration("5 seconds"), CommitTransactionReply.SERIALIZABLE_CLASS);
+            expectMsgClass(duration("5 seconds"), CommitTransactionReply.class);
             watcher.expectMsgClass(duration("5 seconds"), Terminated.class);
         }};
     }
index ce6145d..0ab92dd 100644 (file)
@@ -15,6 +15,7 @@ import static org.mockito.Matchers.isA;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
+import static org.opendaylight.controller.cluster.datastore.DataStoreVersions.CURRENT_VERSION;
 import akka.actor.ActorPath;
 import akka.actor.ActorSelection;
 import akka.actor.Props;
@@ -38,8 +39,6 @@ import org.opendaylight.controller.cluster.datastore.messages.CanCommitTransacti
 import org.opendaylight.controller.cluster.datastore.messages.CanCommitTransactionReply;
 import org.opendaylight.controller.cluster.datastore.messages.CommitTransaction;
 import org.opendaylight.controller.cluster.datastore.messages.CommitTransactionReply;
-import org.opendaylight.controller.cluster.datastore.messages.PreCommitTransaction;
-import org.opendaylight.controller.cluster.datastore.messages.PreCommitTransactionReply;
 import org.opendaylight.controller.cluster.datastore.messages.SerializableMessage;
 import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
 import org.opendaylight.controller.cluster.raft.utils.DoNothingActor;
@@ -148,21 +147,19 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
 
         ThreePhaseCommitCohortProxy proxy = setupProxy(1);
 
-        setupMockActorContext(CanCommitTransaction.SERIALIZABLE_CLASS,
-                CanCommitTransactionReply.YES);
+        setupMockActorContext(CanCommitTransaction.class, CanCommitTransactionReply.yes(CURRENT_VERSION));
 
         ListenableFuture<Boolean> future = proxy.canCommit();
 
         assertEquals("canCommit", true, future.get(5, TimeUnit.SECONDS));
 
-        setupMockActorContext(CanCommitTransaction.SERIALIZABLE_CLASS,
-                CanCommitTransactionReply.NO);
+        setupMockActorContext(CanCommitTransaction.class, CanCommitTransactionReply.no(CURRENT_VERSION));
 
         future = proxy.canCommit();
 
         assertEquals("canCommit", false, future.get(5, TimeUnit.SECONDS));
 
-        verifyCohortInvocations(2, CanCommitTransaction.SERIALIZABLE_CLASS);
+        verifyCohortInvocations(2, CanCommitTransaction.class);
     }
 
     @Test
@@ -170,14 +167,14 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
 
         ThreePhaseCommitCohortProxy proxy = setupProxy(2);
 
-        setupMockActorContext(CanCommitTransaction.SERIALIZABLE_CLASS,
-                CanCommitTransactionReply.YES, CanCommitTransactionReply.YES);
+        setupMockActorContext(CanCommitTransaction.class,
+                CanCommitTransactionReply.yes(CURRENT_VERSION), CanCommitTransactionReply.yes(CURRENT_VERSION));
 
         ListenableFuture<Boolean> future = proxy.canCommit();
 
         assertEquals("canCommit", true, future.get(5, TimeUnit.SECONDS));
 
-        verifyCohortInvocations(2, CanCommitTransaction.SERIALIZABLE_CLASS);
+        verifyCohortInvocations(2, CanCommitTransaction.class);
     }
 
     @Test
@@ -185,8 +182,9 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
 
         ThreePhaseCommitCohortProxy proxy = setupProxy(3);
 
-        setupMockActorContext(CanCommitTransaction.SERIALIZABLE_CLASS,
-                CanCommitTransactionReply.YES, CanCommitTransactionReply.NO, CanCommitTransactionReply.YES);
+        setupMockActorContext(CanCommitTransaction.class,
+                CanCommitTransactionReply.yes(CURRENT_VERSION), CanCommitTransactionReply.no(CURRENT_VERSION),
+                CanCommitTransactionReply.yes(CURRENT_VERSION));
 
         ListenableFuture<Boolean> future = proxy.canCommit();
 
@@ -194,7 +192,7 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
 
         assertEquals("canCommit", false, actual);
 
-        verifyCohortInvocations(2, CanCommitTransaction.SERIALIZABLE_CLASS);
+        verifyCohortInvocations(2, CanCommitTransaction.class);
     }
 
     @Test(expected = TestException.class)
@@ -202,7 +200,7 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
 
         ThreePhaseCommitCohortProxy proxy = setupProxy(1);
 
-        setupMockActorContext(CanCommitTransaction.SERIALIZABLE_CLASS, new TestException());
+        setupMockActorContext(CanCommitTransaction.class, new TestException());
 
         propagateExecutionExceptionCause(proxy.canCommit());
     }
@@ -212,8 +210,8 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
 
         ThreePhaseCommitCohortProxy proxy = setupProxy(1);
 
-        setupMockActorContext(CanCommitTransaction.SERIALIZABLE_CLASS,
-                new PreCommitTransactionReply());
+        setupMockActorContext(CanCommitTransaction.class,
+                new CommitTransactionReply());
 
         proxy.canCommit().get(5, TimeUnit.SECONDS);
     }
@@ -226,7 +224,7 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
         try {
             propagateExecutionExceptionCause(proxy.canCommit());
         } finally {
-            verifyCohortInvocations(0, CanCommitTransaction.SERIALIZABLE_CLASS);
+            verifyCohortInvocations(0, CanCommitTransaction.class);
         }
     }
 
@@ -235,9 +233,6 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
         // Precommit is currently a no-op
         ThreePhaseCommitCohortProxy proxy = setupProxy(1);
 
-        setupMockActorContext(PreCommitTransaction.SERIALIZABLE_CLASS,
-                new PreCommitTransactionReply());
-
         proxy.preCommit().get(5, TimeUnit.SECONDS);
     }
 
@@ -245,23 +240,23 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
     public void testAbort() throws Exception {
         ThreePhaseCommitCohortProxy proxy = setupProxy(1);
 
-        setupMockActorContext(AbortTransaction.SERIALIZABLE_CLASS, new AbortTransactionReply());
+        setupMockActorContext(AbortTransaction.class, new AbortTransactionReply());
 
         proxy.abort().get(5, TimeUnit.SECONDS);
 
-        verifyCohortInvocations(1, AbortTransaction.SERIALIZABLE_CLASS);
+        verifyCohortInvocations(1, AbortTransaction.class);
     }
 
     @Test
     public void testAbortWithFailure() throws Exception {
         ThreePhaseCommitCohortProxy proxy = setupProxy(1);
 
-        setupMockActorContext(AbortTransaction.SERIALIZABLE_CLASS, new RuntimeException("mock"));
+        setupMockActorContext(AbortTransaction.class, new RuntimeException("mock"));
 
         // The exception should not get propagated.
         proxy.abort().get(5, TimeUnit.SECONDS);
 
-        verifyCohortInvocations(1, AbortTransaction.SERIALIZABLE_CLASS);
+        verifyCohortInvocations(1, AbortTransaction.class);
     }
 
     @Test
@@ -272,7 +267,7 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
         // The exception should not get propagated.
         proxy.abort().get(5, TimeUnit.SECONDS);
 
-        verifyCohortInvocations(0, AbortTransaction.SERIALIZABLE_CLASS);
+        verifyCohortInvocations(0, AbortTransaction.class);
     }
 
     @Test
@@ -280,12 +275,12 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
 
         ThreePhaseCommitCohortProxy proxy = setupProxy(2);
 
-        setupMockActorContext(CommitTransaction.SERIALIZABLE_CLASS, new CommitTransactionReply(),
+        setupMockActorContext(CommitTransaction.class, new CommitTransactionReply(),
                 new CommitTransactionReply());
 
         proxy.commit().get(5, TimeUnit.SECONDS);
 
-        verifyCohortInvocations(2, CommitTransaction.SERIALIZABLE_CLASS);
+        verifyCohortInvocations(2, CommitTransaction.class);
     }
 
     @Test(expected = TestException.class)
@@ -293,7 +288,7 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
 
         ThreePhaseCommitCohortProxy proxy = setupProxy(2);
 
-        setupMockActorContext(CommitTransaction.SERIALIZABLE_CLASS, new CommitTransactionReply(),
+        setupMockActorContext(CommitTransaction.class, new CommitTransactionReply(),
                 new TestException());
 
         propagateExecutionExceptionCause(proxy.commit());
@@ -304,7 +299,7 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
 
         ThreePhaseCommitCohortProxy proxy = setupProxy(1);
 
-        setupMockActorContext(CommitTransaction.SERIALIZABLE_CLASS, new PreCommitTransactionReply());
+        setupMockActorContext(CommitTransaction.class, new AbortTransactionReply());
 
         proxy.commit().get(5, TimeUnit.SECONDS);
     }
@@ -318,7 +313,7 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
             propagateExecutionExceptionCause(proxy.commit());
         } finally {
 
-            verifyCohortInvocations(0, CommitTransaction.SERIALIZABLE_CLASS);
+            verifyCohortInvocations(0, CommitTransaction.class);
         }
 
     }
@@ -328,13 +323,10 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
 
         ThreePhaseCommitCohortProxy proxy = setupProxy(2);
 
-        setupMockActorContext(CanCommitTransaction.SERIALIZABLE_CLASS,
-                CanCommitTransactionReply.YES, CanCommitTransactionReply.YES);
-
-        setupMockActorContext(PreCommitTransaction.SERIALIZABLE_CLASS,
-                new PreCommitTransactionReply(), new PreCommitTransactionReply());
+        setupMockActorContext(CanCommitTransaction.class,
+                CanCommitTransactionReply.yes(CURRENT_VERSION), CanCommitTransactionReply.yes(CURRENT_VERSION));
 
-        setupMockActorContext(CommitTransaction.SERIALIZABLE_CLASS,
+        setupMockActorContext(CommitTransaction.class,
                 new CommitTransactionReply(), new CommitTransactionReply());
 
         assertEquals(10.0, actorContext.getTxCreationLimit(), 1e-15);
@@ -343,8 +335,8 @@ public class ThreePhaseCommitCohortProxyTest extends AbstractActorTest {
         proxy.preCommit().get(5, TimeUnit.SECONDS);
         proxy.commit().get(5, TimeUnit.SECONDS);
 
-        verifyCohortInvocations(2, CanCommitTransaction.SERIALIZABLE_CLASS);
-        verifyCohortInvocations(2, CommitTransaction.SERIALIZABLE_CLASS);
+        verifyCohortInvocations(2, CanCommitTransaction.class);
+        verifyCohortInvocations(2, CommitTransaction.class);
 
     }
 
index eb64920..4dd64bd 100644 (file)
@@ -719,7 +719,7 @@ public class EntityOwnershipShardTest extends AbstractEntityOwnershipTest {
         modifications.addModification(new MergeModification(ENTITY_OWNERS_PATH, node));
 
         shard.tell(modifications, sender.getRef());
-        sender.expectMsgClass(CommitTransactionReply.SERIALIZABLE_CLASS);
+        sender.expectMsgClass(CommitTransactionReply.class);
     }
 
     private static BatchedModifications newBatchedModifications() {
@@ -932,7 +932,8 @@ public class EntityOwnershipShardTest extends AbstractEntityOwnershipTest {
                         }
                     }
 
-                    getSender().tell(CommitTransactionReply.INSTANCE.toSerializable(), getSelf());
+                    getSender().tell(CommitTransactionReply.instance(DataStoreVersions.CURRENT_VERSION).
+                            toSerializable(), getSelf());
                 } else {
                     sendReply = true;
                 }
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/AbortTransactionReplyTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/AbortTransactionReplyTest.java
new file mode 100644 (file)
index 0000000..bbc4da5
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.cluster.datastore.messages;
+
+import static org.junit.Assert.assertEquals;
+import java.io.Serializable;
+import org.apache.commons.lang.SerializationUtils;
+import org.junit.Test;
+import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
+import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
+
+/**
+ * Unit tests for AbortTransactionReply.
+ *
+ * @author Thomas Pantelis
+ */
+public class AbortTransactionReplyTest {
+
+    @Test
+    public void testSerialization() {
+        AbortTransactionReply expected = AbortTransactionReply.instance(DataStoreVersions.CURRENT_VERSION);
+
+        Object serialized = expected.toSerializable();
+        assertEquals("Serialized type", AbortTransactionReply.class, serialized.getClass());
+
+        AbortTransactionReply actual = (AbortTransactionReply)SerializationUtils.clone((Serializable) serialized);
+        assertEquals("getVersion", DataStoreVersions.CURRENT_VERSION, actual.getVersion());
+    }
+
+    @Test
+    public void testSerializationWithPreBoronVersion() {
+        AbortTransactionReply expected = AbortTransactionReply.instance(DataStoreVersions.LITHIUM_VERSION);
+
+        Object serialized = expected.toSerializable();
+        assertEquals("Serialized type", ThreePhaseCommitCohortMessages.AbortTransactionReply.class, serialized.getClass());
+    }
+
+    @Test
+    public void testIsSerializedType() {
+        assertEquals("isSerializedType", true, AbortTransactionReply.isSerializedType(
+                ThreePhaseCommitCohortMessages.AbortTransactionReply.newBuilder().build()));
+
+        assertEquals("isSerializedType", true, AbortTransactionReply.isSerializedType(new AbortTransactionReply()));
+        assertEquals("isSerializedType", false, AbortTransactionReply.isSerializedType(new Object()));
+    }
+}
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/AbortTransactionTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/AbortTransactionTest.java
new file mode 100644 (file)
index 0000000..78c2686
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.cluster.datastore.messages;
+
+import static org.junit.Assert.assertEquals;
+import java.io.Serializable;
+import org.apache.commons.lang.SerializationUtils;
+import org.junit.Test;
+import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
+import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
+
+/**
+ * Unit tests for AbortTransaction.
+ *
+ * @author Thomas Pantelis
+ */
+public class AbortTransactionTest {
+
+    @Test
+    public void testSerialization() {
+        AbortTransaction expected = new AbortTransaction("txId", DataStoreVersions.CURRENT_VERSION);
+
+        Object serialized = expected.toSerializable();
+        assertEquals("Serialized type", AbortTransaction.class, serialized.getClass());
+
+        AbortTransaction actual = AbortTransaction.fromSerializable(
+                SerializationUtils.clone((Serializable) serialized));
+        assertEquals("getTransactionID", expected.getTransactionID(), actual.getTransactionID());
+        assertEquals("getVersion", DataStoreVersions.CURRENT_VERSION, actual.getVersion());
+    }
+
+    @Test
+    public void testSerializationWithPreBoronVersion() {
+        AbortTransaction expected = new AbortTransaction("txId", DataStoreVersions.LITHIUM_VERSION);
+
+        Object serialized = expected.toSerializable();
+        assertEquals("Serialized type", ThreePhaseCommitCohortMessages.AbortTransaction.class, serialized.getClass());
+
+        AbortTransaction actual = AbortTransaction.fromSerializable(
+                SerializationUtils.clone((Serializable) serialized));
+        assertEquals("getTransactionID", expected.getTransactionID(), actual.getTransactionID());
+        assertEquals("getVersion", DataStoreVersions.LITHIUM_VERSION, actual.getVersion());
+    }
+
+    @Test
+    public void testIsSerializedType() {
+        assertEquals("isSerializedType", true, AbortTransaction.isSerializedType(
+                ThreePhaseCommitCohortMessages.AbortTransaction.newBuilder().setTransactionId("").build()));
+
+        assertEquals("isSerializedType", true, AbortTransaction.isSerializedType(new AbortTransaction()));
+        assertEquals("isSerializedType", false, AbortTransaction.isSerializedType(new Object()));
+    }
+}
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/CanCommitTransactionReplyTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/CanCommitTransactionReplyTest.java
new file mode 100644 (file)
index 0000000..15c3bc7
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.cluster.datastore.messages;
+
+import static org.junit.Assert.assertEquals;
+import java.io.Serializable;
+import org.apache.commons.lang.SerializationUtils;
+import org.junit.Test;
+import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
+import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
+
+/**
+ * Unit tests for CanCommitTransactionReply.
+ *
+ * @author Thomas Pantelis
+ */
+public class CanCommitTransactionReplyTest {
+
+    @Test
+    public void testSerialization() {
+        testSerialization(CanCommitTransactionReply.yes(DataStoreVersions.CURRENT_VERSION),
+                CanCommitTransactionReply.class);
+        testSerialization(CanCommitTransactionReply.no(DataStoreVersions.CURRENT_VERSION),
+                CanCommitTransactionReply.class);
+    }
+
+    private void testSerialization(CanCommitTransactionReply expected, Class<?> expSerialized) {
+        Object serialized = expected.toSerializable();
+        assertEquals("Serialized type", expSerialized, serialized.getClass());
+
+        CanCommitTransactionReply actual = CanCommitTransactionReply.fromSerializable(
+                SerializationUtils.clone((Serializable) serialized));
+        assertEquals("getCanCommit", expected.getCanCommit(), actual.getCanCommit());
+        assertEquals("getVersion", DataStoreVersions.CURRENT_VERSION, actual.getVersion());
+    }
+
+    @Test
+    public void testSerializationWithPreBoronVersion() {
+        testSerialization(CanCommitTransactionReply.yes(DataStoreVersions.LITHIUM_VERSION),
+                ThreePhaseCommitCohortMessages.CanCommitTransactionReply.class);
+        testSerialization(CanCommitTransactionReply.no(DataStoreVersions.LITHIUM_VERSION),
+                ThreePhaseCommitCohortMessages.CanCommitTransactionReply.class);
+    }
+
+    @Test
+    public void testIsSerializedType() {
+        assertEquals("isSerializedType", true, CanCommitTransactionReply.isSerializedType(
+                ThreePhaseCommitCohortMessages.CanCommitTransactionReply.newBuilder().setCanCommit(true).build()));
+
+        assertEquals("isSerializedType", true, CanCommitTransactionReply.isSerializedType(
+                new CanCommitTransactionReply()));
+        assertEquals("isSerializedType", false, CanCommitTransactionReply.isSerializedType(new Object()));
+    }
+}
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/CanCommitTransactionTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/CanCommitTransactionTest.java
new file mode 100644 (file)
index 0000000..18da821
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.cluster.datastore.messages;
+
+import static org.junit.Assert.assertEquals;
+import java.io.Serializable;
+import org.apache.commons.lang.SerializationUtils;
+import org.junit.Test;
+import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
+import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
+
+/**
+ * Unit tests for CanCommitTransaction.
+ *
+ * @author Thomas Pantelis
+ */
+public class CanCommitTransactionTest {
+
+    @Test
+    public void testSerialization() {
+        CanCommitTransaction expected = new CanCommitTransaction("txId", DataStoreVersions.CURRENT_VERSION);
+
+        Object serialized = expected.toSerializable();
+        assertEquals("Serialized type", CanCommitTransaction.class, serialized.getClass());
+
+        CanCommitTransaction actual = CanCommitTransaction.fromSerializable(
+                SerializationUtils.clone((Serializable) serialized));
+        assertEquals("getTransactionID", expected.getTransactionID(), actual.getTransactionID());
+        assertEquals("getVersion", DataStoreVersions.CURRENT_VERSION, actual.getVersion());
+    }
+
+    @Test
+    public void testSerializationWithPreBoronVersion() {
+        CanCommitTransaction expected = new CanCommitTransaction("txId", DataStoreVersions.LITHIUM_VERSION);
+
+        Object serialized = expected.toSerializable();
+        assertEquals("Serialized type", ThreePhaseCommitCohortMessages.CanCommitTransaction.class, serialized.getClass());
+
+        CanCommitTransaction actual = CanCommitTransaction.fromSerializable(
+                SerializationUtils.clone((Serializable) serialized));
+        assertEquals("getTransactionID", expected.getTransactionID(), actual.getTransactionID());
+        assertEquals("getVersion", DataStoreVersions.LITHIUM_VERSION, actual.getVersion());
+    }
+
+    @Test
+    public void testIsSerializedType() {
+        assertEquals("isSerializedType", true, CanCommitTransaction.isSerializedType(
+                ThreePhaseCommitCohortMessages.CanCommitTransaction.newBuilder().
+                setTransactionId("").build()));
+
+        assertEquals("isSerializedType", true, CanCommitTransaction.isSerializedType(new CanCommitTransaction()));
+        assertEquals("isSerializedType", false, CanCommitTransaction.isSerializedType(new Object()));
+    }
+}
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/CommitTransactionReplyTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/CommitTransactionReplyTest.java
new file mode 100644 (file)
index 0000000..c0b548b
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.cluster.datastore.messages;
+
+import static org.junit.Assert.assertEquals;
+import java.io.Serializable;
+import org.apache.commons.lang.SerializationUtils;
+import org.junit.Test;
+import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
+import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
+
+/**
+ * Unit tests for CommitTransactionReply.
+ *
+ * @author Thomas Pantelis
+ */
+public class CommitTransactionReplyTest {
+
+    @Test
+    public void testSerialization() {
+        CommitTransactionReply expected = CommitTransactionReply.instance(DataStoreVersions.CURRENT_VERSION);
+
+        Object serialized = expected.toSerializable();
+        assertEquals("Serialized type", CommitTransactionReply.class, serialized.getClass());
+
+        CommitTransactionReply actual = (CommitTransactionReply)SerializationUtils.clone((Serializable) serialized);
+        assertEquals("getVersion", DataStoreVersions.CURRENT_VERSION, actual.getVersion());
+    }
+
+    @Test
+    public void testSerializationWithPreBoronVersion() {
+        CommitTransactionReply expected = CommitTransactionReply.instance(DataStoreVersions.LITHIUM_VERSION);
+
+        Object serialized = expected.toSerializable();
+        assertEquals("Serialized type", ThreePhaseCommitCohortMessages.CommitTransactionReply.class, serialized.getClass());
+    }
+
+    @Test
+    public void testIsSerializedType() {
+        assertEquals("isSerializedType", true, CommitTransactionReply.isSerializedType(
+                ThreePhaseCommitCohortMessages.CommitTransactionReply.newBuilder().build()));
+
+        assertEquals("isSerializedType", true, CommitTransactionReply.isSerializedType(new CommitTransactionReply()));
+        assertEquals("isSerializedType", false, CommitTransactionReply.isSerializedType(new Object()));
+    }
+}
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/CommitTransactionTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/CommitTransactionTest.java
new file mode 100644 (file)
index 0000000..0f46c58
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.cluster.datastore.messages;
+
+import static org.junit.Assert.assertEquals;
+import java.io.Serializable;
+import org.apache.commons.lang.SerializationUtils;
+import org.junit.Test;
+import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
+import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
+
+/**
+ * Unit tests for CommitTransaction.
+ *
+ * @author Thomas Pantelis
+ */
+public class CommitTransactionTest {
+
+    @Test
+    public void testSerialization() {
+        CommitTransaction expected = new CommitTransaction("txId", DataStoreVersions.CURRENT_VERSION);
+
+        Object serialized = expected.toSerializable();
+        assertEquals("Serialized type", CommitTransaction.class, serialized.getClass());
+
+        CommitTransaction actual = CommitTransaction.fromSerializable(
+                SerializationUtils.clone((Serializable) serialized));
+        assertEquals("getTransactionID", expected.getTransactionID(), actual.getTransactionID());
+        assertEquals("getVersion", DataStoreVersions.CURRENT_VERSION, actual.getVersion());
+    }
+
+    @Test
+    public void testSerializationWithPreBoronVersion() {
+        CommitTransaction expected = new CommitTransaction("txId", DataStoreVersions.LITHIUM_VERSION);
+
+        Object serialized = expected.toSerializable();
+        assertEquals("Serialized type", ThreePhaseCommitCohortMessages.CommitTransaction.class, serialized.getClass());
+
+        CommitTransaction actual = CommitTransaction.fromSerializable(
+                SerializationUtils.clone((Serializable) serialized));
+        assertEquals("getTransactionID", expected.getTransactionID(), actual.getTransactionID());
+        assertEquals("getVersion", DataStoreVersions.LITHIUM_VERSION, actual.getVersion());
+    }
+
+    @Test
+    public void testIsSerializedType() {
+        assertEquals("isSerializedType", true, CommitTransaction.isSerializedType(
+                ThreePhaseCommitCohortMessages.CommitTransaction.newBuilder().setTransactionId("").build()));
+
+        assertEquals("isSerializedType", true, CommitTransaction.isSerializedType(new CommitTransaction()));
+        assertEquals("isSerializedType", false, CommitTransaction.isSerializedType(new Object()));
+    }
+}

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.