OPNFLWPLUG-1032: Neon-MRI: Bump odlparent, yangtools, mdsal
[openflowplugin.git] / applications / notification-supplier / src / main / java / org / opendaylight / openflowplugin / applications / notification / supplier / impl / item / stat / FlowTableStatNotificationSupplierImpl.java
index 834a9a70b826e2b96d6bff9f6253101f089c9570..971547c434b76d3b5858f591f6eaed6b6f1603ac 100644 (file)
@@ -14,7 +14,6 @@ import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 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.TableKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsData;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsUpdate;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsUpdateBuilder;
@@ -32,33 +31,35 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 public class FlowTableStatNotificationSupplierImpl extends
         AbstractNotificationSupplierForItemStat<FlowTableStatistics, FlowTableStatisticsUpdate> {
 
-    private static final InstanceIdentifier<FlowTableStatistics> wildCardedInstanceIdent =
-            getNodeWildII().augmentation(FlowCapableNode.class).child(Table.class)
-                    .augmentation(FlowTableStatisticsData.class).child(FlowTableStatistics.class);
+    private static final InstanceIdentifier<FlowTableStatistics> FLOW_TABLE_STATISTICS_INSTANCE_IDENTIFIER
+            getNodeWildII().augmentation(FlowCapableNode.class).child(Table.class)
+            .augmentation(FlowTableStatisticsData.class).child(FlowTableStatistics.class);
 
     /**
      * Constructor register supplier as DataTreeChangeListener and create wildCarded InstanceIdentifier.
      *
      * @param notifProviderService - {@link NotificationProviderService}
-     * @param db - {@link DataBroker}
+     * @param db                   - {@link DataBroker}
      */
-    public FlowTableStatNotificationSupplierImpl(final NotificationProviderService notifProviderService, final DataBroker db) {
+    public FlowTableStatNotificationSupplierImpl(final NotificationProviderService notifProviderService,
+                                                 final DataBroker db) {
         super(notifProviderService, db, FlowTableStatistics.class);
     }
 
     @Override
     public InstanceIdentifier<FlowTableStatistics> getWildCardPath() {
-        return wildCardedInstanceIdent;
+        return FLOW_TABLE_STATISTICS_INSTANCE_IDENTIFIER;
     }
 
     @Override
-    public FlowTableStatisticsUpdate createNotification(final FlowTableStatistics o,
-            final InstanceIdentifier<FlowTableStatistics> path) {
-        Preconditions.checkArgument(o != null);
+    public FlowTableStatisticsUpdate createNotification(final FlowTableStatistics flowTableStatistics,
+                                                        final InstanceIdentifier<FlowTableStatistics> path) {
+        Preconditions.checkArgument(flowTableStatistics != null);
         Preconditions.checkArgument(path != null);
 
-        final FlowTableAndStatisticsMapBuilder ftsmBuilder = new FlowTableAndStatisticsMapBuilder(o);
-        ftsmBuilder.setKey(new FlowTableAndStatisticsMapKey(new TableId(path.firstKeyOf(Table.class, TableKey.class).getId())));
+        final FlowTableAndStatisticsMapBuilder ftsmBuilder = new FlowTableAndStatisticsMapBuilder(flowTableStatistics);
+        ftsmBuilder.withKey(new FlowTableAndStatisticsMapKey(
+                new TableId(path.firstKeyOf(Table.class).getId())));
 
         final FlowTableStatisticsUpdateBuilder builder = new FlowTableStatisticsUpdateBuilder();
         builder.setId(getNodeId(path));