2 * Copyright (c) 2015 Cisco Systems, Inc. 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.mdsal.dom.api;
10 import com.google.common.util.concurrent.FluentFuture;
11 import java.util.Optional;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.mdsal.common.api.ReadFailedException;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
15 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
17 @Deprecated(forRemoval = true)
18 public interface DOMDataTreeReadCursor extends DOMDataTreeCursor {
20 * Read a particular node from the snapshot.
22 * @param child Child identifier
23 * @return a FluentFuture containing the result of the read. Once complete:
25 * <li>If the data at the supplied path exists, the Future returns an Optional object
26 * containing the data.</li>
27 * <li>If the data at the supplied path does not exist, the Future returns
28 * Optional#empty().</li>
29 * <li>If the read of the data fails, the Future will fail with a
30 * {@link ReadFailedException} or an exception derived from ReadFailedException.</li>
32 * @throws IllegalArgumentException when specified path does not identify a valid child.
34 @NonNull FluentFuture<Optional<NormalizedNode<?, ?>>> readNode(@NonNull PathArgument child);
37 * Checks if data is available in the logical data store located at provided path.
40 * Note: a successful result from this method makes no guarantee that a subsequent call to
41 * {@link #readNode(PathArgument)} will succeed. It is possible that the data resides in a data store on a remote
42 * node and, if that node goes down or a network failure occurs, a subsequent read would fail.
43 * Another scenario is if the data is deleted in between the calls to <code>exists</code> and
44 * <code>readNode</code>
46 * @param child Child identifier
47 * @return a FluentFuture containing the result of the read. Once complete:
49 * <li>If the data at the supplied path exists, the Future returns a Boolean whose value
50 * is true, false otherwise</li>
51 * <li>If checking for the data fails, the Future will
52 * fail with a {@link ReadFailedException} or an exception derived from
53 * ReadFailedException.</li>
56 @NonNull FluentFuture<Boolean> exists(@NonNull PathArgument child);