2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
\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
8 package org.opendaylight.controller.sal.binding.api;
\r
10 import java.util.concurrent.Future;
\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
18 * DataBrokerService provides unified access to the data stores available in the
\r
22 * @see DataProviderService
\r
25 public interface DataBrokerService extends BindingAwareService {
\r
28 * Returns a data from specified Data Store.
\r
30 * Returns all the data visible to the consumer from specified Data Store.
\r
33 * Interface generated from YANG module representing root of data
\r
35 * Identifier of the store, from which will be data retrieved
\r
36 * @return data visible to the consumer
\r
38 <T extends DataRoot> T getData(DataStoreIdentifier store, Class<T> rootType);
\r
41 * Returns a filtered subset of data from specified Data Store.
\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
51 * @see http://tools.ietf.org/html/rfc6241#section-6
\r
53 * Interface generated from YANG module representing root of data
\r
55 * Identifier of the store, from which will be data retrieved
\r
57 * Data tree filter similar to the NETCONF filter
\r
60 <T extends DataRoot> T getData(DataStoreIdentifier store, T filter);
\r
63 * Returns a candidate data which are not yet commited.
\r
67 * Interface generated from YANG module representing root of data
\r
69 * Identifier of the store, from which will be data retrieved
\r
72 <T extends DataRoot> T getCandidateData(DataStoreIdentifier store,
\r
76 * Returns a filtered subset of candidate data from specified Data Store.
\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
86 * @see http://tools.ietf.org/html/rfc6241#section-6
\r
88 * Interface generated from YANG module representing root of data
\r
90 * Identifier of the store, from which will be data retrieved
\r
92 * A filter data root
\r
95 <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, T filter);
\r
100 * Interface generated from YANG module representing root of data
\r
102 * Identifier of the store, in which will be the candidate data
\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
109 RpcResult<DataRoot> editCandidateData(DataStoreIdentifier store,
\r
110 DataRoot changeSet);
\r
113 * Initiates a two-phase commit of candidate data.
\r
116 * The {@link Consumer} could initiate a commit of candidate data
\r
119 * The successful commit changes the state of the system and may affect
\r
120 * several components.
\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
129 * @see DataCommitHandler for further information how two-phase commit is
\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
136 Future<RpcResult<Void>> commit(DataStoreIdentifier store);
\r