2 * Copyright (c) 2018 Pantheon Technologies, s.r.o. 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
8 package org.opendaylight.controller.sal.core.compat;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.collect.ForwardingObject;
13 import com.google.common.util.concurrent.FluentFuture;
14 import java.util.Optional;
15 import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
16 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
17 import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
18 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
19 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
21 @Deprecated(forRemoval = true)
22 public class DOMDataTreeReadTransactionAdapter extends ForwardingObject implements DOMDataTreeReadTransaction {
23 private final DOMDataReadOnlyTransaction delegate;
25 public DOMDataTreeReadTransactionAdapter(final DOMDataReadOnlyTransaction delegate) {
26 this.delegate = requireNonNull(delegate);
30 public Object getIdentifier() {
31 return delegate().getIdentifier();
35 public FluentFuture<Optional<NormalizedNode<?, ?>>> read(final LogicalDatastoreType store,
36 final YangInstanceIdentifier path) {
37 return TransactionUtils.read(delegate(), store, path);
41 public FluentFuture<Boolean> exists(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
42 return TransactionUtils.exists(delegate(), store, path);
51 protected DOMDataReadOnlyTransaction delegate() {