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.access.concepts.TransactionIdentifier;
12 import org.opendaylight.controller.cluster.datastore.ReadWriteShardDataTreeTransaction;
15 * Transaction ReadyTransaction message that is forwarded to the local Shard from the ShardTransaction.
17 * @author Thomas Pantelis
19 public class ForwardedReadyTransaction {
20 private final TransactionIdentifier transactionId;
21 private final ReadWriteShardDataTreeTransaction transaction;
22 private final boolean doImmediateCommit;
23 private final short txnClientVersion;
25 public ForwardedReadyTransaction(TransactionIdentifier transactionId, short txnClientVersion,
26 ReadWriteShardDataTreeTransaction transaction, boolean doImmediateCommit) {
27 this.transactionId = Preconditions.checkNotNull(transactionId);
28 this.transaction = Preconditions.checkNotNull(transaction);
29 this.txnClientVersion = txnClientVersion;
30 this.doImmediateCommit = doImmediateCommit;
33 public TransactionIdentifier getTransactionId() {
37 public ReadWriteShardDataTreeTransaction getTransaction() {
41 public short getTxnClientVersion() {
42 return txnClientVersion;
45 public boolean isDoImmediateCommit() {
46 return doImmediateCommit;
50 public String toString() {
51 return "ForwardedReadyTransaction [transactionId=" + transactionId + ", doImmediateCommit=" + doImmediateCommit
52 + ", txnClientVersion=" + txnClientVersion + "]";