Deprecate all MD-SAL APIs
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / md / sal / dom / broker / impl / DOMForwardedReadOnlyTransaction.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  */
8 package org.opendaylight.controller.md.sal.dom.broker.impl;
9
10 import com.google.common.base.Optional;
11 import com.google.common.util.concurrent.CheckedFuture;
12 import java.util.Map;
13 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
14 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
15 import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
16 import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
17 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
18 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
19
20 /**
21  * Read Only Transaction, which is composed of several
22  * {@link DOMStoreReadTransaction} transactions. Subtransaction is selected by
23  * {@link LogicalDatastoreType} type parameter in
24  * {@link #read(LogicalDatastoreType, YangInstanceIdentifier)}.
25  */
26 @Deprecated
27 class DOMForwardedReadOnlyTransaction extends
28         AbstractDOMForwardedCompositeTransaction<LogicalDatastoreType, DOMStoreReadTransaction> implements
29         DOMDataReadOnlyTransaction {
30
31     protected DOMForwardedReadOnlyTransaction(final Object identifier,
32             final Map<LogicalDatastoreType, DOMStoreReadTransaction> backingTxs) {
33         super(identifier, backingTxs);
34     }
35
36     @Override
37     public CheckedFuture<Optional<NormalizedNode<?,?>>, ReadFailedException> read(
38             final LogicalDatastoreType store, final YangInstanceIdentifier path) {
39         return getSubtransaction(store).read(path);
40     }
41
42     @Override
43     public CheckedFuture<Boolean, ReadFailedException> exists(
44         final LogicalDatastoreType store,
45         final YangInstanceIdentifier path) {
46         return getSubtransaction(store).exists(path);
47     }
48
49     @Override
50     public void close() {
51         closeSubtransactions();
52     }
53 }

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