Switch to MD-SAL APIs
[openflowplugin.git] / applications / notification-supplier / src / main / java / org / opendaylight / openflowplugin / applications / notification / supplier / impl / item / FlowNotificationSupplierImpl.java
index e982146bc75c896f794ab895d976ce0daeec542a..9d2e9fdfcbb9e836061b9c6e08e7fedbcc048a36 100644 (file)
@@ -5,12 +5,11 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.applications.notification.supplier.impl.item;
 
 import com.google.common.base.Preconditions;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.NotificationPublishService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
@@ -27,41 +26,42 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
  * Implementation define a contract between {@link Flow} data object
  * and {@link FlowAdded}, {@link FlowUpdated} and {@link FlowRemoved} notifications.
  */
-public class FlowNotificationSupplierImpl extends
-        AbstractNotificationSupplierForItem<Flow, FlowAdded, FlowUpdated, FlowRemoved> {
+public class FlowNotificationSupplierImpl extends AbstractNotificationSupplierForItem<Flow, FlowAdded, FlowUpdated,
+        FlowRemoved> {
 
-    private static final InstanceIdentifier<Flow> wildCardedInstanceIdent = getNodeWildII().augmentation(FlowCapableNode.class).child(Table.class).child(Flow.class);
+    private static final InstanceIdentifier<Flow> FLOW_INSTANCE_IDENTIFIER = getNodeWildII()
+            .augmentation(FlowCapableNode.class).child(Table.class).child(Flow.class);
 
     /**
-     * Constructor register supplier as DataChangeLister and create wildCarded InstanceIdentifier.
+     * Constructor register supplier as DataTreeChangeListener and create wildCarded InstanceIdentifier.
      *
-     * @param notifProviderService - {@link NotificationProviderService}
-     * @param db - {@link DataBroker}
+     * @param notifProviderService - {@link NotificationPublishService}
+     * @param db                   - {@link DataBroker}
      */
-    public FlowNotificationSupplierImpl(final NotificationProviderService notifProviderService, final DataBroker db) {
+    public FlowNotificationSupplierImpl(final NotificationPublishService notifProviderService, final DataBroker db) {
         super(notifProviderService, db, Flow.class);
     }
 
     @Override
     public InstanceIdentifier<Flow> getWildCardPath() {
-        return wildCardedInstanceIdent;
+        return FLOW_INSTANCE_IDENTIFIER;
     }
 
     @Override
-    public FlowAdded createNotification(final Flow o, final InstanceIdentifier<Flow> path) {
-        Preconditions.checkArgument(o != null);
+    public FlowAdded createNotification(final Flow dataTreeItemObject, final InstanceIdentifier<Flow> path) {
+        Preconditions.checkArgument(dataTreeItemObject != null);
         Preconditions.checkArgument(path != null);
-        final FlowAddedBuilder builder = new FlowAddedBuilder(o);
+        final FlowAddedBuilder builder = new FlowAddedBuilder(dataTreeItemObject);
         builder.setFlowRef(new FlowRef(path));
         builder.setNode(createNodeRef(path));
         return builder.build();
     }
 
     @Override
-    public FlowUpdated updateNotification(final Flow o, final InstanceIdentifier<Flow> path) {
-        Preconditions.checkArgument(o != null);
+    public FlowUpdated updateNotification(final Flow flow, final InstanceIdentifier<Flow> path) {
+        Preconditions.checkArgument(flow != null);
         Preconditions.checkArgument(path != null);
-        final FlowUpdatedBuilder builder = new FlowUpdatedBuilder(o);
+        final FlowUpdatedBuilder builder = new FlowUpdatedBuilder(flow);
         builder.setFlowRef(new FlowRef(path));
         builder.setNode(createNodeRef(path));
         return builder.build();