- if (nodeProps == null)
- return null;
- Map<Long, ISwitch> switches = controller.getSwitches();
- for (Map.Entry<Long, ISwitch> entry : switches.entrySet()) {
- ISwitch sw = entry.getValue();
- Node node = OFSwitchToNode(sw);
- Map<String, Property> propMap = null;
- if (isDefaultContainer) {
- propMap = new HashMap<String, Property>();
- byte tables = sw.getTables();
- Tables t = new Tables(tables);
- if (t != null) {
- propMap.put(Tables.TablesPropName, t);
- }
- int cap = sw.getCapabilities();
- Capabilities c = new Capabilities(cap);
- if (c != null) {
- propMap.put(Capabilities.CapabilitiesPropName, c);
- }
- int act = sw.getActions();
- Actions a = new Actions(act);
- if (a != null) {
- propMap.put(Actions.ActionsPropName, a);
- }
- int buffers = sw.getBuffers();
- Buffers b = new Buffers(buffers);
- if (b != null) {
- propMap.put(Buffers.BuffersPropName, b);
- }
- Date connectedSince = sw.getConnectedDate();
- Long connectedSinceTime = (connectedSince == null) ? 0
- : connectedSince.getTime();
- TimeStamp timeStamp = new TimeStamp(connectedSinceTime,
- "connectedSince");
- propMap.put(TimeStamp.TimeStampPropName, timeStamp);
- nodeProps.put(node, propMap);
- }
- }