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 / FlowStatNotificationSupplierImpl.java
index 47125c510bd15ca0773600baff443c2296a3fc53..01d4f62da83520cf14e2fb76bbddf708d9218f91 100644 (file)
@@ -15,7 +15,6 @@ 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.table.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowStatisticsData;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowsStatisticsUpdate;
@@ -29,34 +28,37 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
  * Implementation define a contract between {@link FlowStatistics} data object
  * and {@link FlowsStatisticsUpdate} notification.
  */
-public class FlowStatNotificationSupplierImpl extends AbstractNotificationSupplierForItemStat<FlowStatistics, FlowsStatisticsUpdate> {
+public class FlowStatNotificationSupplierImpl extends AbstractNotificationSupplierForItemStat<FlowStatistics,
+        FlowsStatisticsUpdate> {
 
-    private static final InstanceIdentifier<FlowStatistics> wildCardedInstanceIdent =
-            getNodeWildII().augmentation(FlowCapableNode.class).child(Table.class)
-                    .child(Flow.class).augmentation(FlowStatisticsData.class).child(FlowStatistics.class);
+    private static final InstanceIdentifier<FlowStatistics> FLOW_STATISTICS_INSTANCE_IDENTIFIER = getNodeWildII()
+            .augmentation(FlowCapableNode.class).child(Table.class).child(Flow.class)
+            .augmentation(FlowStatisticsData.class).child(FlowStatistics.class);
 
     /**
      * Constructor register supplier as DataTreeChangeListener and create wildCarded InstanceIdentifier.
      *
      * @param notifProviderService - {@link NotificationProviderService}
-     * @param db - {@link DataBroker}
+     * @param db                   - {@link DataBroker}
      */
-    public FlowStatNotificationSupplierImpl(final NotificationProviderService notifProviderService, final DataBroker db) {
+    public FlowStatNotificationSupplierImpl(final NotificationProviderService notifProviderService,
+                                            final DataBroker db) {
         super(notifProviderService, db, FlowStatistics.class);
     }
 
     @Override
     public InstanceIdentifier<FlowStatistics> getWildCardPath() {
-        return wildCardedInstanceIdent;
+        return FLOW_STATISTICS_INSTANCE_IDENTIFIER;
     }
 
     @Override
-    public FlowsStatisticsUpdate createNotification(final FlowStatistics o, final InstanceIdentifier<FlowStatistics> path) {
-        Preconditions.checkArgument(o != null);
+    public FlowsStatisticsUpdate createNotification(final FlowStatistics flowStatistics,
+                                                    final InstanceIdentifier<FlowStatistics> path) {
+        Preconditions.checkArgument(flowStatistics != null);
         Preconditions.checkArgument(path != null);
 
-        final FlowAndStatisticsMapListBuilder fsmlBuilder = new FlowAndStatisticsMapListBuilder(o);
-        fsmlBuilder.setFlowId(new FlowId(path.firstKeyOf(Flow.class, FlowKey.class).getId().getValue()));
+        final FlowAndStatisticsMapListBuilder fsmlBuilder = new FlowAndStatisticsMapListBuilder(flowStatistics);
+        fsmlBuilder.setFlowId(new FlowId(path.firstKeyOf(Flow.class).getId().getValue()));
 
         final FlowsStatisticsUpdateBuilder builder = new FlowsStatisticsUpdateBuilder();
         builder.setId(getNodeId(path));