2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.sal.core.api.data;
11 import java.util.concurrent.Future;
13 import org.opendaylight.controller.sal.common.DataStoreIdentifier;
14 import org.opendaylight.controller.sal.core.api.BrokerService;
15 import org.opendaylight.controller.sal.core.api.Consumer;
16 import org.opendaylight.controller.sal.core.api.Provider;
17 import org.opendaylight.yangtools.yang.common.RpcResult;
18 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
19 import org.opendaylight.yangtools.yang.data.api.MutableCompositeNode;
20 import org.opendaylight.yangtools.yang.data.api.Node;
24 * DataBrokerService provides unified access to the data stores available in the
28 * @see DataProviderService
31 public interface DataBrokerService extends BrokerService {
34 Set<DataStoreIdentifier> getDataStores();
37 * Returns a data from specified Data Store.
39 * Returns all the data visible to the consumer from specified Data Store.
42 * Identifier of the store, from which will be data retrieved
43 * @return data visible to the consumer
45 CompositeNode getData(DataStoreIdentifier store);
48 * Returns a filtered subset of data from specified Data Store.
51 * The filter is modeled as an hierarchy of {@link Node} starting with
52 * {@link CompositeNode} representing data root. The semantics of the filter
53 * tree is the same as filter semantics defined in the NETCONF protocol for
54 * rpc operations <code>get</code> and <code>get-config</code> in Section 6
58 * @see http://tools.ietf.org/html/rfc6241#section-6
60 * Identifier of the store, from which will be data retrieved
62 * Data tree filter similar to the NETCONF filter
65 CompositeNode getData(DataStoreIdentifier store, CompositeNode filter);
68 * Returns a candidate data which are not yet commited.
72 * Identifier of the store, from which will be data retrieved
75 CompositeNode getCandidateData(DataStoreIdentifier store);
78 * Returns a filtered subset of candidate data from specified Data Store.
81 * The filter is modeled as an hierarchy of {@link Node} starting with
82 * {@link CompositeNode} representing data root. The semantics of the filter
83 * tree is the same as filter semantics defined in the NETCONF protocol for
84 * rpc operations <code>get</code> and <code>get-config</code> in Section 6
88 * @see http://tools.ietf.org/html/rfc6241#section-6
90 * Identifier of the store, from which will be data retrieved
92 * A CompositeNode filter
95 CompositeNode getCandidateData(DataStoreIdentifier store,
96 CompositeNode filter);
101 * Identifier of the store, in which will be the candidate data
104 * Modification of data tree.
105 * @return Result object containing the modified data tree if the operation
106 * was successful, otherwise list of the encountered errors.
108 RpcResult<CompositeNode> editCandidateData(DataStoreIdentifier store,
109 MutableCompositeNode changeSet);
112 * Initiates a two-phase commit of candidate data.
115 * The {@link Consumer} could initiate a commit of candidate data
118 * The successful commit changes the state of the system and may affect
119 * several components.
122 * The effects of successful commit of data are described in the
123 * specifications and YANG models describing the {@link Provider} components
124 * of controller. It is assumed that {@link Consumer} has an understanding
128 * @see DataCommitHandler for further information how two-phase commit is
131 * Identifier of the store, where commit should occur.
132 * @return Result of the commit, containing success information or list of
133 * encountered errors, if commit was not successful.
135 Future<RpcResult<Void>> commit(DataStoreIdentifier store);