Do not generate 'isFoo()' methods
[mdsal.git] / dom / mdsal-dom-api / src / main / java / org / opendaylight / mdsal / dom / api / DOMDataTreeReadCursor.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.mdsal.dom.api;
9
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;
16
17 @Deprecated(forRemoval = true)
18 public interface DOMDataTreeReadCursor extends DOMDataTreeCursor {
19     /**
20      * Read a particular node from the snapshot.
21      *
22      * @param child Child identifier
23      * @return a FluentFuture containing the result of the read. Once complete:
24      *         <ul>
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>
31      *         </ul>
32      * @throws IllegalArgumentException when specified path does not identify a valid child.
33      */
34     @NonNull FluentFuture<Optional<NormalizedNode<?, ?>>> readNode(@NonNull PathArgument child);
35
36     /**
37      * Checks if data is available in the logical data store located at provided path.
38      *
39      * <p>
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>
45      *
46      * @param child Child identifier
47      * @return a FluentFuture containing the result of the read. Once complete:
48      *         <ul>
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>
54      *         </ul>
55      */
56     @NonNull FluentFuture<Boolean> exists(@NonNull PathArgument child);
57 }