BUG-1092: adjust to YangInstanceIdentifier
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / md / sal / dom / broker / impl / DOMForwardedReadWriteTransaction.java
1 /*
2  * Copyright (c) 2014 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  */package org.opendaylight.controller.md.sal.dom.broker.impl;
8
9 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
10 import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
11 import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
12 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
13 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
14
15 import com.google.common.base.Optional;
16 import com.google.common.collect.ImmutableMap;
17 import com.google.common.util.concurrent.ListenableFuture;
18
19 /**
20  *
21  * Read-Write Transaction, which is composed of several
22  * {@link DOMStoreReadWriteTransaction} transactions. Subtransaction is selected by
23  * {@link LogicalDatastoreType} type parameter in:
24  *
25  * <ul>
26  * <li>{@link #read(LogicalDatastoreType, YangInstanceIdentifier)}
27  * <li>{@link #put(LogicalDatastoreType, YangInstanceIdentifier, NormalizedNode)}
28  * <li>{@link #delete(LogicalDatastoreType, YangInstanceIdentifier)}
29  * <li>{@link #merge(LogicalDatastoreType, YangInstanceIdentifier, NormalizedNode)}
30  * </ul>
31  * {@link #commit()} will result in invocation of
32  * {@link DOMDataCommitImplementation#submit(org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction, Iterable)}
33  * invocation with all {@link org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort} for underlying
34  * transactions.
35  *
36  */
37
38 class DOMForwardedReadWriteTransaction extends DOMForwardedWriteTransaction<DOMStoreReadWriteTransaction> implements
39         DOMDataReadWriteTransaction {
40
41     protected DOMForwardedReadWriteTransaction(final Object identifier,
42             final ImmutableMap<LogicalDatastoreType, DOMStoreReadWriteTransaction> backingTxs,
43             final DOMDataCommitImplementation commitImpl) {
44         super(identifier, backingTxs, commitImpl);
45     }
46
47     @Override
48     public ListenableFuture<Optional<NormalizedNode<?, ?>>> read(final LogicalDatastoreType store,
49             final YangInstanceIdentifier path) {
50         return getSubtransaction(store).read(path);
51     }
52 }

©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.