Merge "BUG-614: introduce AbstractRuntimeCodeGenerator"
[controller.git] / opendaylight / md-sal / sal-dom-api / src / main / java / org / opendaylight / controller / sal / core / 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.core.api.data;
9
10 import org.opendaylight.controller.md.sal.common.api.data.DataProvisionService;
11 import org.opendaylight.controller.sal.common.DataStoreIdentifier;
12 import org.opendaylight.controller.sal.core.api.Provider;
13 import org.opendaylight.yangtools.concepts.Registration;
14 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
15 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
16 import org.opendaylight.controller.md.sal.common.api.data.DataReader;;
17
18 public interface DataProviderService extends
19     DataBrokerService, //
20     DataProvisionService<InstanceIdentifier, CompositeNode>
21     {
22
23     /**
24      * Adds {@link DataValidator} for specified Data Store
25      *
26      * @param store
27      *            Data Store
28      * @param validator
29      *            Validator
30      */
31     public void addValidator(DataStoreIdentifier store, DataValidator validator);
32
33     /**
34      * Removes {@link DataValidator} from specified Data Store
35      *
36      * @param store
37      * @param validator
38      *            Validator
39      */
40     public void removeValidator(DataStoreIdentifier store,
41             DataValidator validator);
42
43     /**
44      * Adds {@link DataRefresher} for specified data store
45      *
46      * @param store
47      * @param refresher
48      */
49     void addRefresher(DataStoreIdentifier store, DataRefresher refresher);
50
51     /**
52      * Removes {@link DataRefresher} from specified data store
53      *
54      * @param store
55      * @param refresher
56      */
57     void removeRefresher(DataStoreIdentifier store, DataRefresher refresher);
58
59
60     Registration<DataReader<InstanceIdentifier, CompositeNode>> registerConfigurationReader(InstanceIdentifier path, DataReader<InstanceIdentifier, CompositeNode> reader);
61
62     Registration<DataReader<InstanceIdentifier, CompositeNode>> registerOperationalReader(InstanceIdentifier path, DataReader<InstanceIdentifier, CompositeNode> reader);
63
64     public interface DataRefresher extends Provider.ProviderFunctionality {
65
66         /**
67          * Fired when some component explicitly requested the data refresh.
68          *
69          * The provider which exposed the {@link DataRefresher} should republish
70          * its provided data by editing the data in all affected data stores.
71          */
72         void refreshData();
73     }
74 }