1 package org.opendaylight.controller.sal.binding.impl;
\r
3 import java.util.concurrent.Future;
\r
4 import java.util.concurrent.atomic.AtomicLong;
\r
6 import org.opendaylight.controller.md.sal.common.impl.service.AbstractDataBroker;
\r
7 import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
\r
8 import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
\r
9 import org.opendaylight.controller.sal.binding.impl.util.BindingAwareDataReaderRouter;
\r
10 import org.opendaylight.controller.sal.common.DataStoreIdentifier;
\r
11 import org.opendaylight.yangtools.yang.binding.DataObject;
\r
12 import org.opendaylight.yangtools.yang.binding.DataRoot;
\r
13 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
\r
14 import org.opendaylight.yangtools.yang.common.RpcResult;
\r
17 public class DataBrokerImpl extends AbstractDataBroker<InstanceIdentifier<? extends DataObject>, DataObject, DataChangeListener> implements
\r
18 DataProviderService, AutoCloseable {
\r
20 private final AtomicLong nextTransaction = new AtomicLong();
\r
21 private final AtomicLong createdTransactionsCount = new AtomicLong();
\r
23 public AtomicLong getCreatedTransactionsCount() {
\r
24 return createdTransactionsCount;
\r
27 public DataBrokerImpl() {
\r
28 setDataReadRouter(new BindingAwareDataReaderRouter());
\r
32 public DataTransactionImpl beginTransaction() {
\r
33 String transactionId = "BA-" + nextTransaction.getAndIncrement();
\r
34 createdTransactionsCount.getAndIncrement();
\r
35 return new DataTransactionImpl(transactionId,this);
\r
40 public <T extends DataRoot> T getData(DataStoreIdentifier store, Class<T> rootType) {
\r
41 throw new UnsupportedOperationException("Deprecated");
\r
46 public <T extends DataRoot> T getData(DataStoreIdentifier store, T filter) {
\r
47 throw new UnsupportedOperationException("Deprecated");
\r
52 public <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, Class<T> rootType) {
\r
53 throw new UnsupportedOperationException("Deprecated");
\r
58 public <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, T filter) {
\r
59 throw new UnsupportedOperationException("Deprecated");
\r
64 public RpcResult<DataRoot> editCandidateData(DataStoreIdentifier store, DataRoot changeSet) {
\r
65 throw new UnsupportedOperationException("Deprecated");
\r
70 public Future<RpcResult<Void>> commit(DataStoreIdentifier store) {
\r
71 throw new UnsupportedOperationException("Deprecated");
\r
76 public DataObject getData(InstanceIdentifier<? extends DataObject> data) {
\r
77 throw new UnsupportedOperationException("Deprecated");
\r
82 public DataObject getConfigurationData(InstanceIdentifier<?> data) {
\r
83 throw new UnsupportedOperationException("Deprecated");
\r
88 public void registerChangeListener(InstanceIdentifier<? extends DataObject> path, DataChangeListener changeListener) {
\r
89 throw new UnsupportedOperationException("Deprecated");
\r
94 public void unregisterChangeListener(InstanceIdentifier<? extends DataObject> path,
\r
95 DataChangeListener changeListener) {
\r
96 throw new UnsupportedOperationException("Deprecated");
\r
100 public void close() throws Exception {
\r