523abb50cab4150421c46d61d6aa345ccab98cd5
[controller.git] / opendaylight / md-sal / sal-binding-api / src / main / java / org / opendaylight / controller / sal / binding / api / data / DataProviderService.java
1 /*
2  * Copyright (c) 2013 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.sal.binding.api.data;
9
10
11 import org.opendaylight.controller.md.sal.common.api.data.DataProvisionService;
12 import org.opendaylight.controller.md.sal.common.api.data.DataReader;
13 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
14 import org.opendaylight.controller.sal.common.DataStoreIdentifier;
15 import org.opendaylight.yangtools.concepts.Registration;
16 import org.opendaylight.yangtools.yang.binding.DataObject;
17 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
18
19 /**
20  * DataProviderService is common access point for {@link BindingAwareProvider} providers
21  * to access data trees described by the YANG model.
22  *
23  */
24 public interface DataProviderService extends DataBrokerService, DataProvisionService<InstanceIdentifier<? extends DataObject>, DataObject> {
25
26     
27     /**
28      * Registers a data reader for particular subtree of overal YANG data tree.
29      * 
30      * Registered data reader is called if anyone tries to read data from 
31      * paths which are nested to provided path.
32      * 
33      * @param path Subpath which is handled by registered data reader
34      * @param reader Instance of reader which 
35      * @return Registration object for reader. Invoking {@link Registration#close()} will unregister reader.
36      */
37     Registration<DataReader<InstanceIdentifier<? extends DataObject>,DataObject>> registerDataReader(InstanceIdentifier<? extends DataObject> path,DataReader<InstanceIdentifier<? extends DataObject>,DataObject> reader);
38 }