BUG-272: fix sal-common-api
[controller.git] / opendaylight / md-sal / sal-common-api / src / main / java / org / opendaylight / controller / md / sal / common / api / data / AsyncReadTransaction.java
1 /*
2  * Copyright (c) 2014 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.controller.md.sal.common.api.data;
9
10 import org.opendaylight.yangtools.concepts.Path;
11
12 import com.google.common.base.Optional;
13 import com.google.common.util.concurrent.ListenableFuture;
14
15 public interface AsyncReadTransaction<P extends Path<P>, D> extends AsyncTransaction<P, D> {
16
17     /**
18      *
19      * Reads data from provided logical data store located at provided path
20      *
21      *
22      * @param store
23      *            Logical data store from which read should occur.
24      * @param path
25      *            Path which uniquely identifies subtree which client want to
26      *            read
27      * @return Listenable Future which contains read result
28      *         <ul>
29      *         <li>If data at supplied path exists the {@link Future#get()}
30      *         returns Optional object containing data
31      *         <li>If data at supplied path does not exists the
32      *         {@link Future#get()} returns {@link Optional#absent()}.
33      *         </ul>
34      */
35     ListenableFuture<Optional<D>> read(LogicalDatastoreType store, P path);
36
37 }