Fix checkstyle warnings for statistics package
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / statistics / services / compatibility / QueueStatisticsToNotificationTransformer.java
index fc4f6c08e11b5056d7a9ee327146b168cc7d9f8e..a431175f870b006687e6bf8a5903da5b27755daa 100644 (file)
@@ -10,11 +10,11 @@ package org.opendaylight.openflowplugin.impl.statistics.services.compatibility;
 
 import java.util.ArrayList;
 import java.util.List;
-import org.opendaylight.openflowplugin.api.openflow.device.DeviceState;
+import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
 import org.opendaylight.openflowplugin.openflow.md.util.InventoryDataServiceUtil;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.Counter32;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.Counter64;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter64;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.queue.rev130925.QueueId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.duration.DurationBuilder;
@@ -28,24 +28,30 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.queue.id.and.statistics.map.QueueIdAndStatisticsMapBuilder;
 
 /**
- * pulled out queue stats to notification transformation
+ * Pulled out queue stats to notification transformation.
  */
 public class QueueStatisticsToNotificationTransformer {
 
+    private QueueStatisticsToNotificationTransformer() {
+        // Hide implicit constructor
+    }
+
     /**
+     * Transform statistics to notification.
+     *
      * @param mpReplyList   raw multipart response from device
-     * @param deviceState   device state
+     * @param deviceInfo    device state
      * @param ofVersion     device version
-     * @param emulatedTxId
+     * @param emulatedTxId  emulated transaction Id
      * @return notification containing flow stats
      */
     public static QueueStatisticsUpdate transformToNotification(final List<MultipartReply> mpReplyList,
-                                                                final DeviceState deviceState,
+                                                                final DeviceInfo deviceInfo,
                                                                 final OpenflowVersion ofVersion,
                                                                 final TransactionId emulatedTxId) {
 
         QueueStatisticsUpdateBuilder notification = new QueueStatisticsUpdateBuilder();
-        notification.setId(deviceState.getNodeId());
+        notification.setId(deviceInfo.getNodeId());
         notification.setMoreReplies(Boolean.FALSE);
         notification.setTransactionId(emulatedTxId);
 
@@ -61,7 +67,7 @@ public class QueueStatisticsToNotificationTransformer {
                         new QueueIdAndStatisticsMapBuilder();
                 statsBuilder.setNodeConnectorId(
                         InventoryDataServiceUtil.nodeConnectorIdfromDatapathPortNo(
-                                deviceState.getFeatures().getDatapathId(),
+                                deviceInfo.getDatapathId(),
                                 queueStats.getPortNo(), ofVersion));
                 statsBuilder.setTransmissionErrors(new Counter64(queueStats.getTxErrors()));
                 statsBuilder.setTransmittedBytes(new Counter64(queueStats.getTxBytes()));
@@ -79,6 +85,4 @@ public class QueueStatisticsToNotificationTransformer {
         }
         return notification.build();
     }
-
-
 }