Add reverse() method in Edge and Path classes
[controller.git] / opendaylight / md-sal / sal-binding-api / src / main / java / org / opendaylight / controller / sal / binding / api / data / DataBrokerService.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 import java.util.concurrent.Future;
11
12 import org.opendaylight.controller.md.sal.common.api.data.DataChangePublisher;
13 import org.opendaylight.controller.md.sal.common.api.data.DataModificationTransactionFactory;
14 import org.opendaylight.controller.md.sal.common.api.data.DataReader;
15 import org.opendaylight.controller.sal.binding.api.BindingAwareService;
16 import org.opendaylight.controller.sal.common.DataStoreIdentifier;
17 import org.opendaylight.yangtools.concepts.ListenerRegistration;
18 import org.opendaylight.yangtools.yang.binding.DataObject;
19 import org.opendaylight.yangtools.yang.binding.DataRoot;
20 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
21 import org.opendaylight.yangtools.yang.common.RpcResult;
22
23 /**
24  * DataBrokerService provides unified access to the data stores available in the
25  * system.
26  * 
27  * 
28  * @see DataProviderService
29  */
30 public interface DataBrokerService extends //
31         BindingAwareService, //
32         DataModificationTransactionFactory<InstanceIdentifier<? extends DataObject>, DataObject>, //
33         DataReader<InstanceIdentifier<? extends DataObject>, DataObject>, //
34         DataChangePublisher<InstanceIdentifier<? extends DataObject>, DataObject, DataChangeListener> {
35
36     /**
37      * Returns a data from specified Data Store.
38      * 
39      * Returns all the data visible to the consumer from specified Data Store.
40      * 
41      * @param <T>
42      *            Interface generated from YANG module representing root of data
43      * @param store
44      *            Identifier of the store, from which will be data retrieved
45      * @return data visible to the consumer
46      */
47     @Deprecated
48     <T extends DataRoot> T getData(DataStoreIdentifier store, Class<T> rootType);
49
50     /**
51      * Returns a filtered subset of data from specified Data Store.
52      * 
53      * <p>
54      * The filter is modeled as an hierarchy of Java TOs starting with
55      * implementation of {@link DataRoot} representing data root. The semantics
56      * of the filter tree is the same as filter semantics defined in the NETCONF
57      * protocol for rpc operations <code>get</code> and <code>get-config</code>
58      * in Section 6 of RFC6241.
59      * 
60      * 
61      * @see http://tools.ietf.org/html/rfc6241#section-6
62      * @param <T>
63      *            Interface generated from YANG module representing root of data
64      * @param store
65      *            Identifier of the store, from which will be data retrieved
66      * @param filter
67      *            Data tree filter similar to the NETCONF filter
68      * @return
69      */
70     @Deprecated
71     <T extends DataRoot> T getData(DataStoreIdentifier store, T filter);
72
73     /**
74      * Returns a candidate data which are not yet commited.
75      * 
76      * 
77      * @param <T>
78      *            Interface generated from YANG module representing root of data
79      * @param store
80      *            Identifier of the store, from which will be data retrieved
81      * @return
82      */
83     @Deprecated
84     <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, Class<T> rootType);
85
86     /**
87      * Returns a filtered subset of candidate data from specified Data Store.
88      * 
89      * <p>
90      * The filter is modeled as an hierarchy of {@link Node} starting with
91      * {@link CompositeNode} representing data root. The semantics of the filter
92      * tree is the same as filter semantics defined in the NETCONF protocol for
93      * rpc operations <code>get</code> and <code>get-config</code> in Section 6
94      * of RFC6241.
95      * 
96      * 
97      * @see http://tools.ietf.org/html/rfc6241#section-6
98      * @param <T>
99      *            Interface generated from YANG module representing root of data
100      * @param store
101      *            Identifier of the store, from which will be data retrieved
102      * @param filter
103      *            A filter data root
104      * @return
105      */
106     @Deprecated
107     <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, T filter);
108
109     /**
110      * 
111      * @param <T>
112      *            Interface generated from YANG module representing root of data
113      * @param store
114      *            Identifier of the store, in which will be the candidate data
115      *            modified
116      * @param changeSet
117      *            Modification of data tree.
118      * @return Result object containing the modified data tree if the operation
119      *         was successful, otherwise list of the encountered errors.
120      */
121     @Deprecated
122     RpcResult<DataRoot> editCandidateData(DataStoreIdentifier store, DataRoot changeSet);
123
124     /**
125      * Initiates a two-phase commit of candidate data.
126      * 
127      * <p>
128      * The {@link Consumer} could initiate a commit of candidate data
129      * 
130      * <p>
131      * The successful commit changes the state of the system and may affect
132      * several components.
133      * 
134      * <p>
135      * The effects of successful commit of data are described in the
136      * specifications and YANG models describing the {@link Provider} components
137      * of controller. It is assumed that {@link Consumer} has an understanding
138      * of this changes.
139      * 
140      * 
141      * @see DataCommitHandler for further information how two-phase commit is
142      *      processed.
143      * @param store
144      *            Identifier of the store, where commit should occur.
145      * @return Result of the commit, containing success information or list of
146      *         encountered errors, if commit was not successful.
147      */
148     @Deprecated
149     Future<RpcResult<Void>> commit(DataStoreIdentifier store);
150
151     @Deprecated
152     DataObject getData(InstanceIdentifier<? extends DataObject> data);
153
154     @Deprecated
155     DataObject getConfigurationData(InstanceIdentifier<?> data);
156     /**
157      * Creates a data modification transaction.
158      * 
159      * @return new blank data modification transaction.
160      */
161     DataModificationTransaction beginTransaction();
162
163     @Deprecated
164     public void registerChangeListener(InstanceIdentifier<? extends DataObject> path, DataChangeListener changeListener);
165
166     @Deprecated
167     public void unregisterChangeListener(InstanceIdentifier<? extends DataObject> path, DataChangeListener changeListener);
168
169     /**
170      * Reads data subtree from configurational store. 
171      * (Store which is populated by consumer, which is usually used to 
172      * inject state into providers. E.g. Flow configuration)-
173      * 
174      */
175     @Override
176     public DataObject readConfigurationData(InstanceIdentifier<? extends DataObject> path);
177     
178     /**
179      * Reads data subtree from operational store. 
180      * (Store which is populated by providers, which is usually used to 
181      * capture state of providers. E.g. Topology)
182      * 
183      */
184     @Override
185     public DataObject readOperationalData(InstanceIdentifier<? extends DataObject> path);
186     
187     /**
188      * Register a data change listener for particular subtree. 
189      * 
190      * Callback is invoked each time data in subtree changes.
191      * 
192      */
193     @Override
194     public ListenerRegistration<DataChangeListener> registerDataChangeListener(
195             InstanceIdentifier<? extends DataObject> path, DataChangeListener listener);
196 }