Switch to MD-SAL APIs
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / statistics / services / compatibility / QueueStatisticsToNotificationTransformer.java
index ca6283d191a2488214947c60ebda2de73f12233d..160e9d345beddfda94d36264c9a021a64d74bd6e 100644 (file)
@@ -10,12 +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.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;
@@ -25,19 +24,24 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.reply.multipart.reply.body.multipart.reply.queue._case.multipart.reply.queue.QueueStats;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.QueueStatisticsUpdate;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.QueueStatisticsUpdateBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.queue.id.and.statistics.map.QueueIdAndStatisticsMap;
 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 {
+public final class QueueStatisticsToNotificationTransformer {
+
+    private QueueStatisticsToNotificationTransformer() {
+        // Hide implicit constructor
+    }
 
     /**
+     * Transform statistics to notification.
+     *
      * @param mpReplyList   raw multipart response from device
-     * @param deviceInfo   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,
@@ -50,7 +54,7 @@ public class QueueStatisticsToNotificationTransformer {
         notification.setMoreReplies(Boolean.FALSE);
         notification.setTransactionId(emulatedTxId);
 
-        notification.setQueueIdAndStatisticsMap(new ArrayList<QueueIdAndStatisticsMap>());
+        notification.setQueueIdAndStatisticsMap(new ArrayList<>());
         for (MultipartReply mpReply : mpReplyList) {
 
             MultipartReplyQueueCase caseBody = (MultipartReplyQueueCase) mpReply.getMultipartReplyBody();
@@ -80,6 +84,4 @@ public class QueueStatisticsToNotificationTransformer {
         }
         return notification.build();
     }
-
-
 }