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.controller.md.sal.dom.store.impl;
10 import org.opendaylight.mdsal.dom.spi.store.AbstractSnapshotBackedTransactionChain;
11 import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
12 import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction;
14 import com.google.common.base.Preconditions;
15 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
16 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot;
18 final class DOMStoreTransactionChainImpl extends AbstractSnapshotBackedTransactionChain<String> {
19 private final InMemoryDOMDataStore store;
21 DOMStoreTransactionChainImpl(final InMemoryDOMDataStore store) {
22 this.store = Preconditions.checkNotNull(store);
26 protected DOMStoreThreePhaseCommitCohort createCohort(final SnapshotBackedWriteTransaction<String> tx, final DataTreeModification modification) {
27 return new ChainedTransactionCommitImpl(store, tx, modification, this);
31 protected DataTreeSnapshot takeSnapshot() {
32 return store.takeSnapshot();
36 protected String nextTransactionIdentifier() {
37 return store.nextIdentifier();
41 protected boolean getDebugTransactions() {
42 return store.getDebugTransactions();
45 void transactionCommited(final SnapshotBackedWriteTransaction<String> transaction) {
46 super.onTransactionCommited(transaction);