Examples of IFloodlightProviderService


Examples of net.floodlightcontroller.core.IFloodlightProviderService

* @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 {
View Full Code Here

Examples of net.floodlightcontroller.core.IFloodlightProviderService

    protected static Logger log = LoggerFactory.getLogger(ControllerRoleResource.class);

    @Get("json")
    public RoleInfo getRole() {
        IFloodlightProviderService floodlightProvider =
                (IFloodlightProviderService)getContext().getAttributes().
                    get(IFloodlightProviderService.class.getCanonicalName());
        return floodlightProvider.getRoleInfo();
    }
View Full Code Here

Examples of net.floodlightcontroller.core.IFloodlightProviderService

        }
        String roleChangeDescription = roleInfo.getRoleChangeDescription();
        if (roleChangeDescription == null)
            roleChangeDescription = "<none>";

        IFloodlightProviderService floodlightProvider =
                (IFloodlightProviderService)getContext().getAttributes().
                    get(IFloodlightProviderService.class.getCanonicalName());

        floodlightProvider.setRole(role, roleChangeDescription);
    }
View Full Code Here

Examples of net.floodlightcontroller.core.IFloodlightProviderService

            for (IOFSwitch sw : table.keySet()) {
                allSwitchTableJson.put(HexString.toHexString(sw.getId()), getOneSwitchTable(table.get(sw)));
            }
        } else {
            try {
                IFloodlightProviderService floodlightProvider =
                        (IFloodlightProviderService)getContext().getAttributes().
                            get(IFloodlightProviderService.class.getCanonicalName());
                long dpid = HexString.toLong(switchId);
                IOFSwitch sw = floodlightProvider.getSwitch(dpid);
                allSwitchTableJson.put(HexString.toHexString(sw.getId()), getOneSwitchTable(table.get(sw)));
            } catch (NumberFormatException e) {
                log.error("Could not decode switch ID = " + switchId);
                setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.