2 * Copyright (c) 2017 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
9 package org.opendaylight.mdsal.binding.javav2.api;
11 import com.google.common.annotations.Beta;
12 import java.util.function.BiConsumer;
13 import org.opendaylight.mdsal.binding.javav2.spec.base.InstanceIdentifier;
14 import org.opendaylight.mdsal.binding.javav2.spec.base.TreeNode;
15 import org.opendaylight.mdsal.common.api.AsyncReadTransaction;
16 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
17 import org.opendaylight.mdsal.common.api.ReadFailedException;
20 * A transaction that provides a stateful read-only view of the data tree.
23 * For more information on usage and examples, please see the documentation in
24 * {@link org.opendaylight.mdsal.common.api.AsyncReadTransaction}.
27 public interface ReadTransaction extends Transaction, AsyncReadTransaction<InstanceIdentifier<?>, TreeNode> {
30 * Reads data from the provided logical data store located at the provided path.
33 * If the target is a subtree, then the whole subtree is read (and will be
34 * accessible from the returned data object).
37 * Logical data store from which read should occur.
39 * Path which uniquely identifies subtree which client want to
41 * @param callback result callback
42 * @param <T> result type
44 <T extends TreeNode> void read(LogicalDatastoreType store, InstanceIdentifier<T> path,
45 BiConsumer<ReadFailedException, T> callback);