use of org.onosproject.net.behaviour.DomainIntentConfigurable in project onos by opennetworkinglab.
the class DomainIntentManager method initDomainIntentDriver.
private DomainIntentConfigurable initDomainIntentDriver(DeviceId deviceId) {
// Attempt to lookup the handler in the cache
DriverHandler handler = driverHandlers.get(deviceId);
if (handler == null) {
try {
// Otherwise create it and if it has DomainIntentConfig behaviour, cache it
handler = driverService.createHandler(deviceId);
if (!handler.driver().hasBehaviour(DomainIntentConfigurable.class)) {
log.warn("DomainIntentConfig behaviour not supported for device {}", deviceId);
return null;
}
} catch (ItemNotFoundException e) {
log.warn("No applicable driver for device {}", deviceId);
return null;
}
driverHandlers.put(deviceId, handler);
}
// Always (re)initialize the pipeline behaviour
log.info("Driver {} bound to device {} ... initializing driver", handler.driver().name(), deviceId);
return handler.behaviour(DomainIntentConfigurable.class);
}
Aggregations