Fix warnings/javadocs in sal-distributed-datastore
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / databroker / DOMBrokerReadWriteTransaction.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.controller.cluster.databroker;
10
11 import com.google.common.base.Optional;
12 import com.google.common.util.concurrent.CheckedFuture;
13 import java.util.Map;
14 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
15 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
16 import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
17 import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
18 import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionFactory;
19 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
20 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
21
22 public class DOMBrokerReadWriteTransaction
23         extends AbstractDOMBrokerWriteTransaction<DOMStoreReadWriteTransaction> implements DOMDataReadWriteTransaction {
24
25     /**
26      * Constructs an instance.
27      *
28      * @param identifier identifier of transaction.
29      * @param storeTxFactories the backing transaction store factories
30      */
31     protected DOMBrokerReadWriteTransaction(Object identifier,
32             Map<LogicalDatastoreType, ? extends DOMStoreTransactionFactory>  storeTxFactories,
33             final AbstractDOMTransactionFactory<?> commitImpl) {
34         super(identifier, storeTxFactories, commitImpl);
35     }
36
37     @Override
38     public CheckedFuture<Optional<NormalizedNode<?,?>>, ReadFailedException> read(
39             final LogicalDatastoreType store, final YangInstanceIdentifier path) {
40         return getSubtransaction(store).read(path);
41     }
42
43     @Override
44     public CheckedFuture<Boolean, ReadFailedException> exists(
45             final LogicalDatastoreType store,
46             final YangInstanceIdentifier path) {
47         return getSubtransaction(store).exists(path);
48     }
49
50     @Override
51     protected DOMStoreReadWriteTransaction createTransaction(LogicalDatastoreType key) {
52         return getTxFactory(key).newReadWriteTransaction();
53     }
54 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.