Bug 2933: BidningDOMDataBrokerAdaper implements DataTreeChangeService 28/17528/4
authorTony Tkacik <ttkacik@cisco.com>
Wed, 1 Apr 2015 10:52:45 +0000 (12:52 +0200)
committerTony Tkacik <ttkacik@cisco.com>
Tue, 7 Apr 2015 11:30:41 +0000 (13:30 +0200)
Change-Id: Ia28d8452a6c203c88c7d1e18208362cf779a7b20
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMDataBrokerAdapter.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMDataTreeChangeListenerAdapter.java

index f63db76..1c43f12 100644 (file)
@@ -25,6 +25,7 @@ import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeChangeService;
 import org.opendaylight.controller.md.sal.dom.api.DOMService;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.yang.binding.DataObject;
 
 /**
  * The DataBrokerImpl simply defers to the DOMDataBroker for all its operations.
@@ -36,7 +37,7 @@ import org.opendaylight.yangtools.concepts.ListenerRegistration;
  *
 
  */
-public class BindingDOMDataBrokerAdapter extends AbstractForwardedDataBroker implements DataBroker {
+public class BindingDOMDataBrokerAdapter extends AbstractForwardedDataBroker implements DataBroker, DataTreeChangeService {
 
 
     static final Factory<DataBroker> BUILDER_FACTORY = new BindingDOMAdapterBuilder.Factory<DataBroker>() {
@@ -96,8 +97,9 @@ public class BindingDOMDataBrokerAdapter extends AbstractForwardedDataBroker imp
 
     }
 
-    public <L extends DataTreeChangeListener> ListenerRegistration<L> registerDataTreeChangeListener(
-            final DataTreeIdentifier treeId, final L listener) {
+    @Override
+    public <T extends DataObject, L extends DataTreeChangeListener<T>> ListenerRegistration<L> registerDataTreeChangeListener(
+            final DataTreeIdentifier<T> treeId, final L listener) {
         if(treeChangeService == null) {
             throw new UnsupportedOperationException("Underlying data broker does not expose DOMDataTreeChangeService.");
         }
index 35b2ce4..ab1348f 100644 (file)
@@ -28,7 +28,7 @@ final class BindingDOMDataTreeChangeListenerAdapter<T extends DataObject> implem
     private final DataTreeChangeListener<T> listener;
     private final LogicalDatastoreType store;
 
-    BindingDOMDataTreeChangeListenerAdapter(final BindingToNormalizedNodeCodec codec, final DataTreeChangeListener listener,
+    BindingDOMDataTreeChangeListenerAdapter(final BindingToNormalizedNodeCodec codec, final DataTreeChangeListener<T> listener,
             final LogicalDatastoreType store) {
         this.codec = Preconditions.checkNotNull(codec);
         this.listener = Preconditions.checkNotNull(listener);