rizard/floodlight — pull request #4 by hwchiu (2014-08-17 15:24:41+00:00)
Title: Openflow 1.3#4

Hi.

As i had mentioned in the issue#3, there will a error message when we use the "/wm/core/controller/switches/json" REST API to fetch the switches information on the OF1.0. I think that is caused by the serializer which calls a unsupported function. I think the solution is that we create a custom serializer for the result value.

Solution
----------
1. Create a custom serializer IOFSwitchSerializer for IOFSwitch.
2. Ask the IOFSwitch use tat custom serializer to serialize when it needs.
3. Since the ControllerSwitchesResource is responsible for processing the REST request for "/wm/core/controller/switches/json", I modify its return value to a set of IOFSwitch instead of the original iterator.

Result
--------
1. It work for OF1.0 and OF1.3
2. I have test the following format and all work.
- /wm/core/controller/switches/json
- /wm/core/controller/switches/json?dpid=00:00:00:00:00:00:00:01
- /wm/core/controller/switches/json?Dpid__StartsWith=00:00

Feel free to give your comments about this problem.

Thanks.