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.core.api.data;
\r
10 import java.util.Set;
\r
11 import java.util.concurrent.Future;
\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
24 * DataBrokerService provides unified access to the data stores available in the
\r
28 * @see DataProviderService
\r
31 public interface DataBrokerService extends BrokerService {
\r
34 Set<DataStoreIdentifier> getDataStores();
\r
37 * Returns a data from specified Data Store.
\r
39 * Returns all the data visible to the consumer from specified Data Store.
\r
42 * Identifier of the store, from which will be data retrieved
\r
43 * @return data visible to the consumer
\r
45 CompositeNode getData(DataStoreIdentifier store);
\r
48 * Returns a filtered subset of data from specified Data Store.
\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
58 * @see http://tools.ietf.org/html/rfc6241#section-6
\r
60 * Identifier of the store, from which will be data retrieved
\r
62 * Data tree filter similar to the NETCONF filter
\r
65 CompositeNode getData(DataStoreIdentifier store, CompositeNode filter);
\r
68 * Returns a candidate data which are not yet commited.
\r
72 * Identifier of the store, from which will be data retrieved
\r
75 CompositeNode getCandidateData(DataStoreIdentifier store);
\r
78 * Returns a filtered subset of candidate data from specified Data Store.
\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
88 * @see http://tools.ietf.org/html/rfc6241#section-6
\r
90 * Identifier of the store, from which will be data retrieved
\r
92 * A CompositeNode filter
\r
95 CompositeNode getCandidateData(DataStoreIdentifier store,
\r
96 CompositeNode filter);
\r
101 * Identifier of the store, in which will be the candidate data
\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
108 RpcResult<CompositeNode> editCandidateData(DataStoreIdentifier store,
\r
109 CompositeNodeModification changeSet);
\r
112 * Initiates a two-phase commit of candidate data.
\r
115 * The {@link Consumer} could initiate a commit of candidate data
\r
118 * The successful commit changes the state of the system and may affect
\r
119 * several components.
\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
128 * @see DataCommitHandler for further information how two-phase commit is
\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
135 Future<RpcResult<Void>> commit(DataStoreIdentifier store);
\r