use of org.onosproject.net.driver.DefaultDriverHandler in project onos by opennetworkinglab.
the class GeneralDeviceProvider method getBehaviour.
private <T extends Behaviour> T getBehaviour(DeviceId deviceId, Class<T> type) {
Driver driver = getDriver(deviceId);
if (driver == null) {
return null;
}
if (!driver.hasBehaviour(type)) {
return null;
}
final DriverData data = new DefaultDriverData(driver, deviceId);
final DefaultDriverHandler handler = new DefaultDriverHandler(data);
return driver.createBehaviour(handler, type);
}
use of org.onosproject.net.driver.DefaultDriverHandler in project onos by opennetworkinglab.
the class OFAgentVirtualFlowEntryBuilder method getDriver.
protected static DriverHandler getDriver(DeviceId devId, DriverService driverService) {
log.debug("calling getDriver for {}", devId);
Driver driver = driverService.getDriver(DRIVER_NAME);
DriverHandler handler = new DefaultDriverHandler(new DefaultDriverData(driver, devId));
return handler;
}
use of org.onosproject.net.driver.DefaultDriverHandler in project onos by opennetworkinglab.
the class OFAgentVirtualGroupBucketEntryBuilder method getDriver.
/**
* Retrieves the driver handler for the specified device.
*
* @param dpid datapath identifier
* @return driver handler
*/
protected DriverHandler getDriver(Dpid dpid) {
DeviceId devId = DeviceId.deviceId(Dpid.uri(dpid));
log.debug("running getDriver for {}", devId);
Driver driver = driverService.getDriver(DRIVER_NAME);
DriverHandler handler = new DefaultDriverHandler(new DefaultDriverData(driver, devId));
return handler;
}
Aggregations