@Override public SwitchRepresentation getSwitchRepresentation(DatapathId dpid) { IOFSwitch sw = this.switches.get(dpid); OFSwitchHandshakeHandler handler = this.switchHandlers.get(dpid); if(sw != null && handler != null) { return new SwitchRepresentation(sw, handler); } return null; }
@Override public List<SwitchRepresentation> getSwitchRepresentations() { List<SwitchRepresentation> representations = new ArrayList<SwitchRepresentation>(); for(DatapathId dpid : this.switches.keySet()) { SwitchRepresentation representation = getSwitchRepresentation(dpid); if(representation != null) { representations.add(representation); } } return representations; }