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.binding.api.data;
10 import java.util.concurrent.Future;
12 import org.opendaylight.controller.sal.binding.api.BindingAwareService;
13 import org.opendaylight.controller.sal.common.DataStoreIdentifier;
14 import org.opendaylight.yangtools.yang.binding.DataObject;
15 import org.opendaylight.yangtools.yang.binding.DataRoot;
16 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
17 import org.opendaylight.yangtools.yang.common.RpcResult;
20 * DataBrokerService provides unified access to the data stores available in the
24 * @see DataProviderService
26 public interface DataBrokerService extends BindingAwareService {
29 * Returns a data from specified Data Store.
31 * Returns all the data visible to the consumer from specified Data Store.
34 * Interface generated from YANG module representing root of data
36 * Identifier of the store, from which will be data retrieved
37 * @return data visible to the consumer
39 <T extends DataRoot> T getData(DataStoreIdentifier store, Class<T> rootType);
42 * Returns a filtered subset of data from specified Data Store.
45 * The filter is modeled as an hierarchy of Java TOs starting with
46 * implementation of {@link DataRoot} representing data root. The semantics
47 * of the filter tree is the same as filter semantics defined in the NETCONF
48 * protocol for rpc operations <code>get</code> and <code>get-config</code>
49 * in Section 6 of RFC6241.
52 * @see http://tools.ietf.org/html/rfc6241#section-6
54 * Interface generated from YANG module representing root of data
56 * Identifier of the store, from which will be data retrieved
58 * Data tree filter similar to the NETCONF filter
62 <T extends DataRoot> T getData(DataStoreIdentifier store, T filter);
65 * Returns a candidate data which are not yet commited.
69 * Interface generated from YANG module representing root of data
71 * Identifier of the store, from which will be data retrieved
75 <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, Class<T> rootType);
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 * Interface generated from YANG module representing root of data
92 * Identifier of the store, from which will be data retrieved
98 <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, T filter);
103 * Interface generated from YANG module representing root of data
105 * Identifier of the store, in which will be the candidate data
108 * Modification of data tree.
109 * @return Result object containing the modified data tree if the operation
110 * was successful, otherwise list of the encountered errors.
113 RpcResult<DataRoot> editCandidateData(DataStoreIdentifier store, DataRoot changeSet);
116 * Initiates a two-phase commit of candidate data.
119 * The {@link Consumer} could initiate a commit of candidate data
122 * The successful commit changes the state of the system and may affect
123 * several components.
126 * The effects of successful commit of data are described in the
127 * specifications and YANG models describing the {@link Provider} components
128 * of controller. It is assumed that {@link Consumer} has an understanding
132 * @see DataCommitHandler for further information how two-phase commit is
135 * Identifier of the store, where commit should occur.
136 * @return Result of the commit, containing success information or list of
137 * encountered errors, if commit was not successful.
140 Future<RpcResult<Void>> commit(DataStoreIdentifier store);
143 DataObject getData(InstanceIdentifier data);
144 DataObject getConfigurationData(InstanceIdentifier data);
147 * Creates a data modification transaction.
149 * @return new blank data modification transaction.
151 DataModification beginTransaction();