X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fmessages%2FForwardedReadyTransaction.java;h=08784d11396f8802c07f13bcde8369c681880fd5;hp=4f8ea51f784ea2e0352eb6aedd8d1dc35469f0ef;hb=4d1709660b7af992d4c382a2a38debb5c7d64fb9;hpb=c66e710cd61119c4779784571e59cdc3b490673f diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/ForwardedReadyTransaction.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/ForwardedReadyTransaction.java index 4f8ea51f78..08784d1139 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/ForwardedReadyTransaction.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/ForwardedReadyTransaction.java @@ -7,8 +7,9 @@ */ package org.opendaylight.controller.cluster.datastore.messages; -import org.opendaylight.controller.cluster.datastore.modification.Modification; -import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort; +import com.google.common.base.Preconditions; +import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier; +import org.opendaylight.controller.cluster.datastore.ReadWriteShardDataTreeTransaction; /** * Transaction ReadyTransaction message that is forwarded to the local Shard from the ShardTransaction. @@ -16,26 +17,38 @@ import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCoh * @author Thomas Pantelis */ public class ForwardedReadyTransaction { - private final String transactionID; - private final DOMStoreThreePhaseCommitCohort cohort; - private final Modification modification; - - public ForwardedReadyTransaction(String transactionID, DOMStoreThreePhaseCommitCohort cohort, - Modification modification) { - this.transactionID = transactionID; - this.cohort = cohort; - this.modification = modification; + private final TransactionIdentifier transactionID; + private final ReadWriteShardDataTreeTransaction transaction; + private final boolean doImmediateCommit; + private final short txnClientVersion; + + public ForwardedReadyTransaction(TransactionIdentifier transactionID, short txnClientVersion, + ReadWriteShardDataTreeTransaction transaction, boolean doImmediateCommit) { + this.transactionID = Preconditions.checkNotNull(transactionID); + this.transaction = Preconditions.checkNotNull(transaction); + this.txnClientVersion = txnClientVersion; + this.doImmediateCommit = doImmediateCommit; } - public String getTransactionID() { + public TransactionIdentifier getTransactionID() { return transactionID; } - public DOMStoreThreePhaseCommitCohort getCohort() { - return cohort; + public ReadWriteShardDataTreeTransaction getTransaction() { + return transaction; + } + + public short getTxnClientVersion() { + return txnClientVersion; + } + + public boolean isDoImmediateCommit() { + return doImmediateCommit; } - public Modification getModification() { - return modification; + @Override + public String toString() { + return "ForwardedReadyTransaction [transactionID=" + transactionID + ", doImmediateCommit=" + doImmediateCommit + + ", txnClientVersion=" + txnClientVersion + "]"; } }