Devices dashlet show port total numbers, modal shows collapsible list
[controller.git] / opendaylight / sal / yang-prototype / sal / sal-binding-api / src / main / java / org / opendaylight / controller / sal / binding / api / 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.binding.api;\r
9 \r
10 import java.util.concurrent.Future;\r
11 \r
12 import org.opendaylight.controller.sal.common.DataStoreIdentifier;\r
13 import org.opendaylight.controller.yang.binding.DataRoot;\r
14 import org.opendaylight.controller.yang.common.RpcResult;\r
15 \r
16 \r
17 /**\r
18  * DataBrokerService provides unified access to the data stores available in the\r
19  * system.\r
20  * \r
21  * \r
22  * @see DataProviderService\r
23 \r
24  */\r
25 public interface DataBrokerService extends BindingAwareService {\r
26 \r
27     /**\r
28      * Returns a data from specified Data Store.\r
29      * \r
30      * Returns all the data visible to the consumer from specified Data Store.\r
31      * \r
32      * @param <T>\r
33      *            Interface generated from YANG module representing root of data\r
34      * @param store\r
35      *            Identifier of the store, from which will be data retrieved\r
36      * @return data visible to the consumer\r
37      */\r
38     <T extends DataRoot> T getData(DataStoreIdentifier store, Class<T> rootType);\r
39 \r
40     /**\r
41      * Returns a filtered subset of data from specified Data Store.\r
42      * \r
43      * <p>\r
44      * The filter is modeled as an hierarchy of Java TOs starting with\r
45      * implementation of {@link DataRoot} representing data root. The semantics\r
46      * of the filter tree is the same as filter semantics defined in the NETCONF\r
47      * protocol for rpc operations <code>get</code> and <code>get-config</code>\r
48      * in Section 6 of RFC6241.\r
49      * \r
50      * \r
51      * @see http://tools.ietf.org/html/rfc6241#section-6\r
52      * @param <T>\r
53      *            Interface generated from YANG module representing root of data\r
54      * @param store\r
55      *            Identifier of the store, from which will be data retrieved\r
56      * @param filter\r
57      *            Data tree filter similar to the NETCONF filter\r
58      * @return\r
59      */\r
60     <T extends DataRoot> T getData(DataStoreIdentifier store, T filter);\r
61 \r
62     /**\r
63      * Returns a candidate data which are not yet commited.\r
64      * \r
65      * \r
66      * @param <T>\r
67      *            Interface generated from YANG module representing root of data\r
68      * @param store\r
69      *            Identifier of the store, from which will be data retrieved\r
70      * @return\r
71      */\r
72     <T extends DataRoot> T getCandidateData(DataStoreIdentifier store,\r
73             Class<T> rootType);\r
74 \r
75     /**\r
76      * Returns a filtered subset of candidate data from specified Data Store.\r
77      * \r
78      * <p>\r
79      * The filter is modeled as an hierarchy of {@link Node} starting with\r
80      * {@link CompositeNode} representing data root. The semantics of the filter\r
81      * tree is the same as filter semantics defined in the NETCONF protocol for\r
82      * rpc operations <code>get</code> and <code>get-config</code> in Section 6\r
83      * of RFC6241.\r
84      * \r
85      * \r
86      * @see http://tools.ietf.org/html/rfc6241#section-6\r
87      * @param <T>\r
88      *            Interface generated from YANG module representing root of data\r
89      * @param store\r
90      *            Identifier of the store, from which will be data retrieved\r
91      * @param filter\r
92      *            A filter data root\r
93      * @return\r
94      */\r
95     <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, T filter);\r
96 \r
97     /**\r
98      * \r
99      * @param <T>\r
100      *            Interface generated from YANG module representing root of data\r
101      * @param store\r
102      *            Identifier of the store, in which will be the candidate data\r
103      *            modified\r
104      * @param changeSet\r
105      *            Modification of data tree.\r
106      * @return Result object containing the modified data tree if the operation\r
107      *         was successful, otherwise list of the encountered errors.\r
108      */\r
109     RpcResult<DataRoot> editCandidateData(DataStoreIdentifier store,\r
110             DataRoot changeSet);\r
111 \r
112     /**\r
113      * Initiates a two-phase commit of candidate data.\r
114      * \r
115      * <p>\r
116      * The {@link Consumer} could initiate a commit of candidate data\r
117      * \r
118      * <p>\r
119      * The successful commit changes the state of the system and may affect\r
120      * several components.\r
121      * \r
122      * <p>\r
123      * The effects of successful commit of data are described in the\r
124      * specifications and YANG models describing the {@link Provider} components\r
125      * of controller. It is assumed that {@link Consumer} has an understanding\r
126      * of this changes.\r
127      * \r
128      * \r
129      * @see DataCommitHandler for further information how two-phase commit is\r
130      *      processed.\r
131      * @param store\r
132      *            Identifier of the store, where commit should occur.\r
133      * @return Result of the commit, containing success information or list of\r
134      *         encountered errors, if commit was not successful.\r
135      */\r
136     Future<RpcResult<Void>> commit(DataStoreIdentifier store);\r
137 }\r