4b01aed6ee7a285d91b9faddc5e03da27091cabf
[controller.git] / opendaylight / md-sal / sal-binding-api / src / main / java / org / opendaylight / controller / sal / binding / api / data / RuntimeDataProvider.java
1 package org.opendaylight.controller.sal.binding.api.data;
2
3 import java.util.Set;
4
5 import org.opendaylight.controller.sal.common.DataStoreIdentifier;
6 import org.opendaylight.yangtools.yang.binding.DataObject;
7 import org.opendaylight.yangtools.yang.binding.DataRoot;
8
9 public interface RuntimeDataProvider {
10
11     Set<DataStoreIdentifier> getSupportedStores();
12     
13     
14     Set<Class<? extends DataRoot>> getProvidedDataRoots();
15     
16     
17     /**
18      * Returns a data from specified Data Store.
19      * 
20      * Returns all the data visible to the consumer from specified Data Store.
21      * 
22      * @param <T>
23      *            Interface generated from YANG module representing root of data
24      * @param store
25      *            Identifier of the store, from which will be data retrieved
26      * @return data visible to the consumer
27      */
28     <T extends DataRoot> T getData(DataStoreIdentifier store, Class<T> rootType);
29
30     /**
31      * Returns a filtered subset of data from specified Data Store.
32      * 
33      * <p>
34      * The filter is modeled as an hierarchy of Java TOs starting with
35      * implementation of {@link DataRoot} representing data root. The semantics
36      * of the filter tree is the same as filter semantics defined in the NETCONF
37      * protocol for rpc operations <code>get</code> and <code>get-config</code>
38      * in Section 6 of RFC6241.
39      * 
40      * 
41      * @see http://tools.ietf.org/html/rfc6241#section-6
42      * @param <T>
43      *            Interface generated from YANG module representing root of data
44      * @param store
45      *            Identifier of the store, from which will be data retrieved
46      * @param filter
47      *            Data tree filter similar to the NETCONF filter
48      * @return
49      */
50     <T extends DataRoot> T getData(DataStoreIdentifier store, T filter);
51 }