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.concurrent.Future;
\r
12 import org.opendaylight.controller.sal.common.DataStoreIdentifier;
\r
13 import org.opendaylight.controller.sal.core.api.BrokerService;
\r
14 import org.opendaylight.controller.sal.core.api.Consumer;
\r
15 import org.opendaylight.controller.sal.core.api.Provider;
\r
16 import org.opendaylight.controller.yang.common.RpcResult;
\r
17 import org.opendaylight.controller.yang.data.api.CompositeNode;
\r
18 import org.opendaylight.controller.yang.data.api.CompositeNodeModification;
\r
19 import org.opendaylight.controller.yang.data.api.Node;
\r
23 * DataBrokerService provides unified access to the data stores available in the
\r
27 * @see DataProviderService
\r
30 public interface DataBrokerService extends BrokerService {
\r
33 * Returns a data from specified Data Store.
\r
35 * Returns all the data visible to the consumer from specified Data Store.
\r
38 * Identifier of the store, from which will be data retrieved
\r
39 * @return data visible to the consumer
\r
41 CompositeNode getData(DataStoreIdentifier store);
\r
44 * Returns a filtered subset of data from specified Data Store.
\r
47 * The filter is modeled as an hierarchy of {@link Node} starting with
\r
48 * {@link CompositeNode} representing data root. The semantics of the filter
\r
49 * tree is the same as filter semantics defined in the NETCONF protocol for
\r
50 * rpc operations <code>get</code> and <code>get-config</code> in Section 6
\r
54 * @see http://tools.ietf.org/html/rfc6241#section-6
\r
56 * Identifier of the store, from which will be data retrieved
\r
58 * Data tree filter similar to the NETCONF filter
\r
61 CompositeNode getData(DataStoreIdentifier store, CompositeNode filter);
\r
64 * Returns a candidate data which are not yet commited.
\r
68 * Identifier of the store, from which will be data retrieved
\r
71 CompositeNode getCandidateData(DataStoreIdentifier store);
\r
74 * Returns a filtered subset of candidate data from specified Data Store.
\r
77 * The filter is modeled as an hierarchy of {@link Node} starting with
\r
78 * {@link CompositeNode} representing data root. The semantics of the filter
\r
79 * tree is the same as filter semantics defined in the NETCONF protocol for
\r
80 * rpc operations <code>get</code> and <code>get-config</code> in Section 6
\r
84 * @see http://tools.ietf.org/html/rfc6241#section-6
\r
86 * Identifier of the store, from which will be data retrieved
\r
88 * A CompositeNode filter
\r
91 CompositeNode getCandidateData(DataStoreIdentifier store,
\r
92 CompositeNode filter);
\r
97 * Identifier of the store, in which will be the candidate data
\r
100 * Modification of data tree.
\r
101 * @return Result object containing the modified data tree if the operation
\r
102 * was successful, otherwise list of the encountered errors.
\r
104 RpcResult<CompositeNode> editCandidateData(DataStoreIdentifier store,
\r
105 CompositeNodeModification changeSet);
\r
108 * Initiates a two-phase commit of candidate data.
\r
111 * The {@link Consumer} could initiate a commit of candidate data
\r
114 * The successful commit changes the state of the system and may affect
\r
115 * several components.
\r
118 * The effects of successful commit of data are described in the
\r
119 * specifications and YANG models describing the {@link Provider} components
\r
120 * of controller. It is assumed that {@link Consumer} has an understanding
\r
124 * @see DataCommitHandler for further information how two-phase commit is
\r
127 * Identifier of the store, where commit should occur.
\r
128 * @return Result of the commit, containing success information or list of
\r
129 * encountered errors, if commit was not successful.
\r
131 Future<RpcResult<Void>> commit(DataStoreIdentifier store);
\r