use of org.onosproject.net.driver.DriverData in project onos by opennetworkinglab.
the class DefaultOpticalDevice method delegate.
@Override
public Device delegate() {
if (delegate == null) {
// dirty work around.
// wanted to pass delegate Device at construction,
// but was not possible. A Behaviour requires no-arg constructor.
checkState(data() != null, "DriverData must exist");
DriverData data = data();
DeviceService service = DefaultServiceDirectory.getService(DeviceService.class);
delegate = checkNotNull(service.getDevice(data.deviceId()), "No Device found for %s", data.deviceId());
}
return delegate;
}
use of org.onosproject.net.driver.DriverData in project onos by opennetworkinglab.
the class OfdpaPipelineTraceableTest method setUpOfdpa.
private PipelineTraceable setUpOfdpa() {
PipelineTraceable behaviour = new OfdpaPipelineTraceable();
DriverData driverData = new DefaultDriverData(ofdpaDriver, OFDPA_DEVICE);
behaviour.setData(driverData);
behaviour.setHandler(testDriverHandlerOfdpa);
behaviour.init();
return behaviour;
}
use of org.onosproject.net.driver.DriverData 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.DriverData 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;
}
use of org.onosproject.net.driver.DriverData in project onos by opennetworkinglab.
the class OfdpaPipelineTraceableTest method setUpOvsOfdpa.
private PipelineTraceable setUpOvsOfdpa() {
PipelineTraceable behaviour = new OfdpaPipelineTraceable();
DriverData driverData = new DefaultDriverData(ovsOfdpaDriver, OFDPA_DEVICE);
behaviour.setData(driverData);
behaviour.setHandler(testDriverHandlerOvsOfdpa);
behaviour.init();
return behaviour;
}
Aggregations