Migrate OSGI compendium reference
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / md / sal / binding / impl / BindingDOMReadTransactionAdapter.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.binding.impl;
9
10 import com.google.common.base.Optional;
11 import com.google.common.util.concurrent.CheckedFuture;
12 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
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.yangtools.yang.binding.DataObject;
17 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
18
19 @Deprecated(forRemoval = true)
20 class BindingDOMReadTransactionAdapter extends AbstractForwardedTransaction<DOMDataReadOnlyTransaction> implements
21         ReadOnlyTransaction {
22
23     protected BindingDOMReadTransactionAdapter(final DOMDataReadOnlyTransaction delegate,
24             final BindingToNormalizedNodeCodec codec) {
25         super(delegate, codec);
26     }
27
28     @Override
29     public <T extends DataObject> CheckedFuture<Optional<T>, ReadFailedException> read(
30             final LogicalDatastoreType store, final InstanceIdentifier<T> path) {
31         return doRead(getDelegate(),store, path);
32     }
33
34     @Override
35     public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store,
36             final InstanceIdentifier<?> path) {
37         return doExists(getDelegate(), store, path);
38     }
39
40     @Override
41     public void close() {
42         getDelegate().close();
43     }
44 }