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