use of org.onosproject.openflow.controller.OpenFlowController in project onos by opennetworkinglab.
the class OplinkPowerConfigUtil method getOpenFlowDevice.
/**
* Returns current switch known to this OF controller.
*
* @return current switch
*/
private OpenFlowSwitch getOpenFlowDevice() {
final DriverHandler handler = behaviour.handler();
final OpenFlowController controller = handler.get(OpenFlowController.class);
final Dpid dpid = Dpid.dpid(handler.data().deviceId().uri());
OpenFlowSwitch sw = controller.getSwitch(dpid);
if (sw == null || !sw.isConnected()) {
log.warn("OpenFlow handshaker driver not found or device is not connected, dpid = {}", dpid);
return null;
}
return sw;
}
Aggregations