2 * Copyright (c) 2014 Cisco 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.mdsal.dom.store.inmemory;
10 import static java.util.Objects.requireNonNull;
12 import org.opendaylight.mdsal.dom.spi.store.AbstractSnapshotBackedTransactionChain;
13 import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
14 import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction;
15 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeModification;
16 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeSnapshot;
18 final class DOMStoreTransactionChainImpl extends AbstractSnapshotBackedTransactionChain<String> {
19 private final InMemoryDOMDataStore store;
21 DOMStoreTransactionChainImpl(final InMemoryDOMDataStore store) {
22 this.store = requireNonNull(store);
26 protected DOMStoreThreePhaseCommitCohort createCohort(final SnapshotBackedWriteTransaction<String> tx,
27 final DataTreeModification modification,
28 final Exception operationError) {
29 return new ChainedTransactionCommitImpl(store, tx, modification, this, operationError);
33 protected DataTreeSnapshot takeSnapshot() {
34 return store.takeSnapshot();
38 protected String nextTransactionIdentifier() {
39 return store.nextIdentifier();
43 protected boolean getDebugTransactions() {
44 return store.getDebugTransactions();
47 void transactionCommited(final SnapshotBackedWriteTransaction<String> transaction) {
48 super.onTransactionCommited(transaction);