X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fprotocol_plugins%2Fopenflow%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fprotocol_plugin%2Fopenflow%2Finternal%2FFlowStatisticsConverter.java;h=74af3db5ef9465e519f36cd5f35e36f196f3f336;hb=18e1184615fd939644d3660e5edcfbb676c187fa;hp=82dbf670a9517ee1b998442f2d524f37628f5815;hpb=541d0a36997f292bb037a2199463431eee538358;p=controller.git diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowStatisticsConverter.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowStatisticsConverter.java index 82dbf670a9..74af3db5ef 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowStatisticsConverter.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowStatisticsConverter.java @@ -9,6 +9,7 @@ package org.opendaylight.controller.protocol_plugin.openflow.internal; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import org.opendaylight.controller.protocol_plugin.openflow.vendorextension.v6extension.V6StatsReply; @@ -34,11 +35,10 @@ public class FlowStatisticsConverter { private List flowOnNodeList; public FlowStatisticsConverter(List statsList) { - if (statsList == null) {// || statsList.isEmpty()) { - this.ofStatsList = new ArrayList(1); // dummy list + if (statsList == null) { + this.ofStatsList = Collections.emptyList(); } else { - this.ofStatsList = statsList; // new - // ArrayList(statsList); + this.ofStatsList = statsList; } this.flowOnNodeList = null; } @@ -59,6 +59,7 @@ public class FlowStatisticsConverter { flow.setPriority(ofFlowStat.getPriority()); flow.setIdleTimeout(ofFlowStat.getIdleTimeout()); flow.setHardTimeout(ofFlowStat.getHardTimeout()); + flow.setId(ofFlowStat.getCookie()); flowOnNode = new FlowOnNode(flow); flowOnNode.setByteCount(ofFlowStat.getByteCount()); flowOnNode.setPacketCount(ofFlowStat.getPacketCount()); @@ -74,6 +75,7 @@ public class FlowStatisticsConverter { flow.setPriority(v6StatsReply.getPriority()); flow.setIdleTimeout(v6StatsReply.getIdleTimeout()); flow.setHardTimeout(v6StatsReply.getHardTimeout()); + flow.setId(v6StatsReply.getCookie()); flowOnNode = new FlowOnNode(flow); flowOnNode.setByteCount(v6StatsReply.getByteCount()); flowOnNode.setPacketCount(v6StatsReply.getPacketCount());