* @author readams
*/
public class SwitchCounterCategoriesResource extends CounterResourceBase {
@Get("json")
public Map<String, Object> retrieve() {
IFloodlightProviderService floodlightProvider =
(IFloodlightProviderService)getContext().getAttributes().
get(IFloodlightProviderService.class.getCanonicalName());
HashMap<String,Object> model = new HashMap<String,Object>();
String switchID = (String) getRequestAttributes().get("switchId");
String counterName = (String) getRequestAttributes().get("counterName");
String layer = (String) getRequestAttributes().get("layer");
if (switchID.equalsIgnoreCase("all")) {
for (Long dpid : floodlightProvider.getAllSwitchDpids()) {
switchID = HexString.toHexString(dpid);
getOneSwitchCounterCategoriesJson(model, switchID, counterName, layer);
}
} else {