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