2 * Copyright (c) 2015 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
9 package org.opendaylight.controller.cluster.databroker;
11 import com.google.common.util.concurrent.FluentFuture;
13 import java.util.Optional;
14 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
15 import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
16 import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadTransaction;
17 import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransactionFactory;
18 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
19 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
21 public class DOMBrokerReadOnlyTransaction
22 extends AbstractDOMBrokerTransaction<DOMStoreReadTransaction> implements DOMDataTreeReadTransaction {
25 * Creates new composite Transactions.
27 * @param identifier Identifier of transaction.
29 protected DOMBrokerReadOnlyTransaction(final Object identifier,
30 final Map<LogicalDatastoreType, ? extends DOMStoreTransactionFactory> storeTxFactories) {
31 super(identifier, storeTxFactories);
35 public FluentFuture<Optional<NormalizedNode>> read(final LogicalDatastoreType store,
36 final YangInstanceIdentifier path) {
37 return getSubtransaction(store).read(path);
41 public FluentFuture<Boolean> exists(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
42 return getSubtransaction(store).exists(path);
47 closeSubtransactions();
51 protected DOMStoreReadTransaction createTransaction(final LogicalDatastoreType key) {
52 return getTxFactory(key).newReadOnlyTransaction();