public static NodeTable toNodeTable(byte tableId, Node node) { log.trace("Openflow table ID: {}", Byte.toString(tableId)); return NodeTableCreator.createNodeTable(tableId, node); }
private List<OFStatistics> filterTableListPerContainer( String container, long switchId, List<OFStatistics> list) { if (list == null) { return Collections.emptyList(); } // Create new filtered list of node tables List<OFStatistics> newList = new ArrayList<OFStatistics>(); for (OFStatistics stat : list) { OFTableStatistics target = (OFTableStatistics) stat; NodeTable nt = NodeTableCreator.createOFNodeTable(target.getTableId(), NodeCreator.createOFNode(switchId)); if (containerOwnsNodeTable(container, nt)) { newList.add(target); } } return newList; }
public List<OFStatistics> filterTableListPerContainer( String container, long switchId, List<OFStatistics> list) { if (list == null) { return null; } // Create new filtered list of node tables List<OFStatistics> newList = new ArrayList<OFStatistics>(); for (OFStatistics stat : list) { OFTableStatistics target = (OFTableStatistics) stat; NodeTable nt = NodeTableCreator.createOFNodeTable( target.getTableId(), NodeCreator.createOFNode(switchId)); if (containerOwnsNodeTable(container, nt)) { newList.add(target); } } return newList; }
public static NodeTable toNodeTable(byte tableId, Node node) { log.trace("Openflow table ID: {}", Byte.toString(tableId)); return NodeTableCreator.createNodeTable(tableId, node); }
public void _readtable(CommandInterpreter ci) { String nodeId = ci.nextArgument(); String tableId = ci.nextArgument(); String cacheReq = ci.nextArgument(); boolean cached; if (nodeId == null) { ci.print("Node id not specified"); return; } if (tableId == null) { ci.print("Table id not specified"); return; } cached = (cacheReq == null) ? true : cacheReq.equals("true"); NodeTable nodeTable = null; Node node = NodeCreator.createOFNode(Long.parseLong(nodeId)); nodeTable = NodeTableCreator.createNodeTable(Byte .valueOf(tableId), node); NodeTableStatistics stats = (cached) ? this .readNodeTable(nodeTable) : this .nonCachedReadNodeTable(nodeTable); if (stats != null) { ci.println(stats.toString()); } else { ci.println("null"); } }