Bug 3020: Use leader version in LeaderStateChanged
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / ReadyLocalTransaction.java
index f8cd18ced20deb245c5e0e1f56b0dcba1b891cb6..0cded39f4e3541616664105aaa97d7fc62268e36 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.controller.cluster.datastore.messages;
 
 import com.google.common.base.Preconditions;
+import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
 
 /**
@@ -22,6 +23,9 @@ public final class ReadyLocalTransaction {
     private final String transactionID;
     private final boolean doCommitOnReady;
 
+    // The version of the remote system used only when needing to convert to BatchedModifications.
+    private short remoteVersion = DataStoreVersions.CURRENT_VERSION;
+
     public ReadyLocalTransaction(final String transactionID, final DataTreeModification modification, final boolean doCommitOnReady) {
         this.transactionID = Preconditions.checkNotNull(transactionID);
         this.modification = Preconditions.checkNotNull(modification);
@@ -39,4 +43,12 @@ public final class ReadyLocalTransaction {
     public boolean isDoCommitOnReady() {
         return doCommitOnReady;
     }
+
+    public short getRemoteVersion() {
+        return remoteVersion;
+    }
+
+    public void setRemoteVersion(short remoteVersion) {
+        this.remoteVersion = remoteVersion;
+    }
 }