X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fprotocol_plugins%2Fopenflow%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fprotocol_plugin%2Fopenflow%2Finternal%2FReadServiceFilter.java;h=e1b244f2c1ede4330d9bda67df4ae693c97af162;hp=d7bf2e22586188f578c72e02d9c453551a380ccd;hb=b23703bef6c3aaafe2dc83608a03b738ad42f945;hpb=5466b63d3ad41fadf0aa4d5bf69b77c32f5d6638 diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/ReadServiceFilter.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/ReadServiceFilter.java index d7bf2e2258..e1b244f2c1 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/ReadServiceFilter.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/ReadServiceFilter.java @@ -189,7 +189,7 @@ public class ReadServiceFilter implements IReadServiceFilter, IContainerListener List flowOnNodeList = new FlowStatisticsConverter(ofList).getFlowOnNodeList(node); List filteredList = filterFlowListPerContainer(container, node, flowOnNodeList); - return (filteredList == null || filteredList.isEmpty()) ? null : filteredList.get(0); + return (filteredList.isEmpty()) ? null : filteredList.get(0); } @Override @@ -203,10 +203,8 @@ public class ReadServiceFilter implements IReadServiceFilter, IContainerListener // Convert and filter the statistics per container List flowOnNodeList = new FlowStatisticsConverter(ofList).getFlowOnNodeList(node); - List filteredList = filterFlowListPerContainer(container, node, flowOnNodeList); - - return (filteredList == null) ? null : filteredList; + return filterFlowListPerContainer(container, node, flowOnNodeList); } @Override @@ -233,10 +231,10 @@ public class ReadServiceFilter implements IReadServiceFilter, IContainerListener * @param list * @return */ - public List filterFlowListPerContainer(String container, + private List filterFlowListPerContainer(String container, Node nodeId, List list) { if (list == null) { - return null; + return Collections.emptyList(); } // Create new filtered list of flows @@ -260,9 +258,9 @@ public class ReadServiceFilter implements IReadServiceFilter, IContainerListener * @param list * @return */ - public List filterPortListPerContainer(String container, long switchId, List list) { + private List filterPortListPerContainer(String container, long switchId, List list) { if (list == null) { - return null; + return Collections.emptyList(); } // Create new filtered list of flows @@ -281,10 +279,10 @@ public class ReadServiceFilter implements IReadServiceFilter, IContainerListener } - public List filterTableListPerContainer( + private List filterTableListPerContainer( String container, long switchId, List list) { if (list == null) { - return null; + return Collections.emptyList(); } // Create new filtered list of node tables @@ -517,7 +515,7 @@ public class ReadServiceFilter implements IReadServiceFilter, IContainerListener long sid = (Long) node.getID(); List ofList = (cached == true) ? statsMgr .getOFPortStatistics(sid) : statsMgr.queryStatistics(sid, - OFStatisticsType.FLOW, null); + OFStatisticsType.PORT, null); List filteredList = filterPortListPerContainer(containerName, sid, ofList); @@ -557,7 +555,7 @@ public class ReadServiceFilter implements IReadServiceFilter, IContainerListener public List readAllNodeTable(String containerName, Node node, boolean cached) { long sid = (Long) node.getID(); List ofList = (cached == true) ? - statsMgr.getOFTableStatistics(sid) : statsMgr.queryStatistics(sid, OFStatisticsType.FLOW, null); + statsMgr.getOFTableStatistics(sid) : statsMgr.queryStatistics(sid, OFStatisticsType.TABLE, null); List filteredList = filterTableListPerContainer(containerName, sid, ofList);