Merge changes I0f752636,Idd154499,Ic35fa3e8
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / sal / binding / impl / DataBrokerImpl.java
1 package org.opendaylight.controller.sal.binding.impl;
2
3 import java.util.concurrent.ExecutorService;
4 import java.util.concurrent.Future;
5 import java.util.concurrent.atomic.AtomicLong;
6
7 import org.opendaylight.controller.md.sal.common.api.data.DataReader;
8 import org.opendaylight.controller.md.sal.common.impl.service.AbstractDataBroker;
9 import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
10 import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
11 import org.opendaylight.controller.sal.binding.impl.util.BindingAwareDataReaderRouter;
12 import org.opendaylight.controller.sal.common.DataStoreIdentifier;
13 import org.opendaylight.yangtools.concepts.Registration;
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;
18
19
20 public class DataBrokerImpl extends AbstractDataBroker<InstanceIdentifier<? extends DataObject>, DataObject, DataChangeListener> implements
21         DataProviderService, AutoCloseable {
22
23     
24     
25     private final AtomicLong nextTransaction = new AtomicLong();
26     
27     public DataBrokerImpl() {
28         setDataReadRouter(new BindingAwareDataReaderRouter());
29     }
30
31     @Override
32     public DataTransactionImpl beginTransaction() {
33         String transactionId = "BA-" + nextTransaction.getAndIncrement();
34         return new DataTransactionImpl(transactionId,this);
35     }
36
37     @Override
38     @Deprecated
39     public <T extends DataRoot> T getData(DataStoreIdentifier store, Class<T> rootType) {
40         throw new UnsupportedOperationException("Deprecated");
41     }
42
43     @Override
44     @Deprecated
45     public <T extends DataRoot> T getData(DataStoreIdentifier store, T filter) {
46         throw new UnsupportedOperationException("Deprecated");
47     }
48
49     @Override
50     @Deprecated
51     public <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, Class<T> rootType) {
52         throw new UnsupportedOperationException("Deprecated");
53     }
54
55     @Override
56     @Deprecated
57     public <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, T filter) {
58         throw new UnsupportedOperationException("Deprecated");
59     }
60
61     @Override
62     @Deprecated
63     public RpcResult<DataRoot> editCandidateData(DataStoreIdentifier store, DataRoot changeSet) {
64         throw new UnsupportedOperationException("Deprecated");
65     }
66
67     @Override
68     @Deprecated
69     public Future<RpcResult<Void>> commit(DataStoreIdentifier store) {
70         throw new UnsupportedOperationException("Deprecated");
71     }
72
73     @Override
74     @Deprecated
75     public DataObject getData(InstanceIdentifier<? extends DataObject> data) {
76         throw new UnsupportedOperationException("Deprecated");
77     }
78
79     @Override
80     @Deprecated
81     public DataObject getConfigurationData(InstanceIdentifier<?> data) {
82         throw new UnsupportedOperationException("Deprecated");
83     }
84
85     @Override
86     @Deprecated
87     public void registerChangeListener(InstanceIdentifier<? extends DataObject> path, DataChangeListener changeListener) {
88         throw new UnsupportedOperationException("Deprecated");
89     }
90
91     @Override
92     @Deprecated
93     public void unregisterChangeListener(InstanceIdentifier<? extends DataObject> path,
94             DataChangeListener changeListener) {
95         throw new UnsupportedOperationException("Deprecated");
96     }
97     
98     @Override
99     public void close() throws Exception {
100         
101     }
102 }