2 * Copyright (c) 2014 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.spi.store;
10 import com.google.common.util.concurrent.FluentFuture;
11 import java.util.Optional;
12 import org.opendaylight.mdsal.common.api.ReadFailedException;
13 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
14 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
16 public interface DOMStoreReadTransaction extends DOMStoreTransaction {
19 * Reads data from provided logical data store located at provided path.
22 * Path which uniquely identifies subtree which client want to
24 * @return a FluentFuture containing the result of the read. The Future blocks until the
25 * commit operation is complete. Once complete:
27 * <li>If the data at the supplied path exists, the Future returns an Optional object
28 * containing the data.</li>
29 * <li>If the data at the supplied path does not exist, the Future returns
30 * Optional#absent().</li>
31 * <li>If the read of the data fails, the Future will fail with a
32 * {@link ReadFailedException} or an exception derived from ReadFailedException.</li>
35 FluentFuture<Optional<NormalizedNode<?,?>>> read(YangInstanceIdentifier path);
38 * Checks if data is available in the logical data store located at provided path.
41 * Note: a successful result from this method makes no guarantee that a subsequent call to {@link #read}
42 * will succeed. It is possible that the data resides in a data store on a remote node and, if that
43 * node goes down or a network failure occurs, a subsequent read would fail. Another scenario is if
44 * the data is deleted in between the calls to <code>exists</code> and <code>read</code>
47 * Path which uniquely identifies subtree which client want to
49 * @return a FluentFuture containing the result of the check.
51 * <li>If the data at the supplied path exists, the Future returns a Boolean
52 * whose value is true, false otherwise</li>
53 * <li>If checking for the data fails, the Future will fail with a
54 * {@link ReadFailedException} or an exception derived from ReadFailedException.</li>
57 FluentFuture<Boolean> exists(YangInstanceIdentifier path);