floodlight/floodlight — pull request #458 by rizard (2014-08-26 17:40:19+00:00)
Title: Improvements/Fixes to REST API

OFFlowStatsReply message serialized when queried via the REST API. A nice (imho) error message is sent back to the user if the request is bad. Checks are done to verify the switch DPID provided is valid and that the switch is actively connected to the controller at the time of the request. Flow stats queried for all switches (i.e. keyword 'all') will use this serializer as well.

Originally hard-coded REST API strings are now defined in a central location to reduce future 'typo' errors.

Serializers for DPIDs, VlanVids, MacAddresses, and IPv4Addresses are updated to use LOXI's toString() for each type, which already pretty-prints the object as e.g. HexString would have before.

TODO still: expand the StatsReplySerializer to serialize other types of OFStatsReply (besides Flow).