2 * Copyright © 2018 Red Hat, Inc. and others.
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.mdsal.binding.util;
10 import com.google.common.util.concurrent.FluentFuture;
11 import java.util.Optional;
12 import org.opendaylight.mdsal.binding.api.ReadTransaction;
13 import org.opendaylight.mdsal.binding.api.query.QueryExpression;
14 import org.opendaylight.mdsal.binding.api.query.QueryResult;
15 import org.opendaylight.yangtools.yang.binding.DataObject;
16 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
19 * Implementation of {@link TypedReadTransaction}.
21 * @param <D> The datastore which the transaction targets.
23 final class TypedReadTransactionImpl<D extends Datastore> extends TypedTransaction<D, ReadTransaction>
24 implements TypedReadTransaction<D> {
25 TypedReadTransactionImpl(final D datastore, final ReadTransaction realTx) {
26 super(datastore, realTx);
30 public <T extends DataObject> FluentFuture<Optional<T>> read(final InstanceIdentifier<T> path) {
31 return delegate().read(getDatastoreType(), path);
35 public FluentFuture<Boolean> exists(final InstanceIdentifier<?> path) {
36 return delegate().exists(getDatastoreType(), path);
40 public <T extends DataObject> FluentFuture<QueryResult<T>> execute(final QueryExpression<T> query) {
41 return doExecute(query);