Merge "Add container context debug osgi cli command to Switch Manager"
[controller.git] / opendaylight / sal / yang-prototype / sal / sal-core-api / src / main / java / org / opendaylight / controller / sal / core / api / data / DataBrokerService.java
1 /*\r
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */\r
8 package org.opendaylight.controller.sal.core.api.data;\r
9 \r
10 import java.util.Set;\r
11 import java.util.concurrent.Future;\r
12 \r
13 import org.opendaylight.controller.sal.common.DataStoreIdentifier;\r
14 import org.opendaylight.controller.sal.core.api.BrokerService;\r
15 import org.opendaylight.controller.sal.core.api.Consumer;\r
16 import org.opendaylight.controller.sal.core.api.Provider;\r
17 import org.opendaylight.controller.yang.common.RpcResult;\r
18 import org.opendaylight.controller.yang.data.api.CompositeNode;\r
19 import org.opendaylight.controller.yang.data.api.CompositeNodeModification;\r
20 import org.opendaylight.controller.yang.data.api.Node;\r
21 \r
22 \r
23 /**\r
24  * DataBrokerService provides unified access to the data stores available in the\r
25  * system.\r
26  * \r
27  * \r
28  * @see DataProviderService\r
29  * \r
30  */\r
31 public interface DataBrokerService extends BrokerService {\r
32 \r
33     \r
34     Set<DataStoreIdentifier> getDataStores();\r
35     \r
36     /**\r
37      * Returns a data from specified Data Store.\r
38      * \r
39      * Returns all the data visible to the consumer from specified Data Store.\r
40      * \r
41      * @param store\r
42      *            Identifier of the store, from which will be data retrieved\r
43      * @return data visible to the consumer\r
44      */\r
45     CompositeNode getData(DataStoreIdentifier store);\r
46 \r
47     /**\r
48      * Returns a filtered subset of data from specified Data Store.\r
49      * \r
50      * <p>\r
51      * The filter is modeled as an hierarchy of {@link Node} starting with\r
52      * {@link CompositeNode} representing data root. The semantics of the filter\r
53      * tree is the same as filter semantics defined in the NETCONF protocol for\r
54      * rpc operations <code>get</code> and <code>get-config</code> in Section 6\r
55      * of RFC6241.\r
56      * \r
57      * \r
58      * @see http://tools.ietf.org/html/rfc6241#section-6\r
59      * @param store\r
60      *            Identifier of the store, from which will be data retrieved\r
61      * @param filter\r
62      *            Data tree filter similar to the NETCONF filter\r
63      * @return\r
64      */\r
65     CompositeNode getData(DataStoreIdentifier store, CompositeNode filter);\r
66 \r
67     /**\r
68      * Returns a candidate data which are not yet commited.\r
69      * \r
70      * \r
71      * @param store\r
72      *            Identifier of the store, from which will be data retrieved\r
73      * @return\r
74      */\r
75     CompositeNode getCandidateData(DataStoreIdentifier store);\r
76 \r
77     /**\r
78      * Returns a filtered subset of candidate data from specified Data Store.\r
79      * \r
80      * <p>\r
81      * The filter is modeled as an hierarchy of {@link Node} starting with\r
82      * {@link CompositeNode} representing data root. The semantics of the filter\r
83      * tree is the same as filter semantics defined in the NETCONF protocol for\r
84      * rpc operations <code>get</code> and <code>get-config</code> in Section 6\r
85      * of RFC6241.\r
86      * \r
87      * \r
88      * @see http://tools.ietf.org/html/rfc6241#section-6\r
89      * @param store\r
90      *            Identifier of the store, from which will be data retrieved\r
91      * @param filter\r
92      *            A CompositeNode filter\r
93      * @return\r
94      */\r
95     CompositeNode getCandidateData(DataStoreIdentifier store,\r
96             CompositeNode filter);\r
97 \r
98     /**\r
99      * \r
100      * @param store\r
101      *            Identifier of the store, in which will be the candidate data\r
102      *            modified\r
103      * @param changeSet\r
104      *            Modification of data tree.\r
105      * @return Result object containing the modified data tree if the operation\r
106      *         was successful, otherwise list of the encountered errors.\r
107      */\r
108     RpcResult<CompositeNode> editCandidateData(DataStoreIdentifier store,\r
109             CompositeNodeModification changeSet);\r
110 \r
111     /**\r
112      * Initiates a two-phase commit of candidate data.\r
113      * \r
114      * <p>\r
115      * The {@link Consumer} could initiate a commit of candidate data\r
116      * \r
117      * <p>\r
118      * The successful commit changes the state of the system and may affect\r
119      * several components.\r
120      * \r
121      * <p>\r
122      * The effects of successful commit of data are described in the\r
123      * specifications and YANG models describing the {@link Provider} components\r
124      * of controller. It is assumed that {@link Consumer} has an understanding\r
125      * of this changes.\r
126      * \r
127      * \r
128      * @see DataCommitHandler for further information how two-phase commit is\r
129      *      processed.\r
130      * @param store\r
131      *            Identifier of the store, where commit should occur.\r
132      * @return Result of the commit, containing success information or list of\r
133      *         encountered errors, if commit was not successful.\r
134      */\r
135     Future<RpcResult<Void>> commit(DataStoreIdentifier store);\r
136 }\r