use of org.onosproject.net.driver.DefaultDriverHandler in project onos by opennetworkinglab.
the class GroupBucketEntryBuilder method getDriver.
private DriverHandler getDriver(Dpid dpid) {
DeviceId deviceId = DeviceId.deviceId(Dpid.uri(dpid));
Driver driver = driverService.getDriver(deviceId);
DriverHandler handler = new DefaultDriverHandler(new DefaultDriverData(driver, deviceId));
return handler;
}
use of org.onosproject.net.driver.DefaultDriverHandler in project onos by opennetworkinglab.
the class SnmpAlarmProvider method getAlarmTranslator.
private DeviceAlarmConfig getAlarmTranslator(SnmpDevice device) {
Driver deviceDriver = driverService.getDriver(device.deviceId());
if (deviceDriver != null && deviceDriver.hasBehaviour(DeviceAlarmConfig.class)) {
DriverData driverData = new DefaultDriverData(deviceDriver, device.deviceId());
DeviceAlarmConfig alarmTranslator = deviceDriver.createBehaviour(driverData, DeviceAlarmConfig.class);
alarmTranslator.setHandler(new DefaultDriverHandler(driverData));
return alarmTranslator;
} else {
log.warn("Device does not support alarm {}", device.deviceId());
}
return null;
}
use of org.onosproject.net.driver.DefaultDriverHandler in project onos by opennetworkinglab.
the class FlowEntryBuilder method getDriver.
/**
* Retrieves the driver handler for the specified device.
*
* @param deviceId device identifier
* @param driverService service handle for the driver service
* @return driver handler
*/
protected static DriverHandler getDriver(DeviceId deviceId, DriverService driverService) {
Driver driver = driverService.getDriver(deviceId);
DriverHandler handler = new DefaultDriverHandler(new DefaultDriverData(driver, deviceId));
return handler;
}
use of org.onosproject.net.driver.DefaultDriverHandler in project onos by opennetworkinglab.
the class GroupModBuilder method buildExtensionAction.
private OFAction buildExtensionAction(ExtensionTreatment i, DeviceId deviceId) {
if (!driverService.isPresent()) {
log.error("No driver service present");
return null;
}
Driver driver = driverService.get().getDriver(deviceId);
if (driver.hasBehaviour(ExtensionTreatmentInterpreter.class)) {
DefaultDriverHandler handler = new DefaultDriverHandler(new DefaultDriverData(driver, deviceId));
ExtensionTreatmentInterpreter interpreter = handler.behaviour(ExtensionTreatmentInterpreter.class);
return interpreter.mapInstruction(factory, i);
}
return null;
}
use of org.onosproject.net.driver.DefaultDriverHandler in project onos by opennetworkinglab.
the class RestDeviceProvider method devicesDiscovery.
private DevicesDiscovery devicesDiscovery(RestSBDevice restSBDevice, Driver driver) {
DriverData driverData = new DefaultDriverData(driver, restSBDevice.deviceId());
DevicesDiscovery devicesDiscovery = driver.createBehaviour(driverData, DevicesDiscovery.class);
devicesDiscovery.setHandler(new DefaultDriverHandler(driverData));
return devicesDiscovery;
}
Aggregations