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.genius.infra;
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.Transaction;
14 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
15 import org.opendaylight.yangtools.yang.binding.DataObject;
16 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
19 * Read transaction which is specific to a single logical datastore (configuration or operational). Designed for use
20 * with {@link ManagedNewTransactionRunner} (it doesn’t support explicit cancel or commit operations).
22 * @see ReadTransaction
24 * @param <D> The logical datastore handled by the transaction.
25 * @deprecated Use {@link org.opendaylight.mdsal.binding.util.TypedReadTransaction} instead.
27 @Deprecated(forRemoval = true)
28 public interface TypedReadTransaction<D extends Datastore>
31 * Reads an object from the given path.
33 * @see ReadTransaction#read(LogicalDatastoreType, InstanceIdentifier)
35 * @param path The path to read from.
36 * @param <T> The type of the expected object.
37 * @return A future providing access to the result of the read, when it’s available, or any error encountered.
39 <T extends DataObject> FluentFuture<Optional<T>> read(InstanceIdentifier<T> path);
42 * Determines if an object exists at the given path.
44 * @see ReadTransaction#exists(LogicalDatastoreType, InstanceIdentifier)
46 * @param path The path to read from.
47 * @return A future providing access to the result of the check, when it’s available, or any error encountered.
49 FluentFuture<Boolean> exists(InstanceIdentifier<?> path);