2 * Copyright (c) 2014 Brocade Communications Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.cluster.datastore.messages;
10 import com.google.common.base.Preconditions;
11 import org.opendaylight.controller.cluster.datastore.ReadWriteShardDataTreeTransaction;
14 * Transaction ReadyTransaction message that is forwarded to the local Shard from the ShardTransaction.
16 * @author Thomas Pantelis
18 public class ForwardedReadyTransaction {
19 private final String transactionID;
20 private final ReadWriteShardDataTreeTransaction transaction;
21 private final boolean doImmediateCommit;
22 private final short txnClientVersion;
24 public ForwardedReadyTransaction(String transactionID, short txnClientVersion,
25 ReadWriteShardDataTreeTransaction transaction, boolean doImmediateCommit) {
26 this.transactionID = Preconditions.checkNotNull(transactionID);
27 this.transaction = Preconditions.checkNotNull(transaction);
28 this.txnClientVersion = txnClientVersion;
29 this.doImmediateCommit = doImmediateCommit;
32 public String getTransactionID() {
36 public ReadWriteShardDataTreeTransaction getTransaction() {
40 public short getTxnClientVersion() {
41 return txnClientVersion;
44 public boolean isDoImmediateCommit() {
45 return doImmediateCommit;
49 public String toString() {
50 return "ForwardedReadyTransaction [transactionID=" + transactionID + ", doImmediateCommit=" + doImmediateCommit
51 + ", txnClientVersion=" + txnClientVersion + "]";