Search in sources :

Example 1 with DriverEvent

use of org.onosproject.net.driver.DriverEvent in project onos by opennetworkinglab.

the class DriverRegistryManager method unregisterProvider.

@Override
public void unregisterProvider(DriverProvider provider) {
    provider.getDrivers().forEach(driver -> {
        removeDriver(driver);
        driverByKey.remove(key(driver.manufacturer(), driver.hwVersion(), driver.swVersion()));
        post(new DriverEvent(DRIVER_REDUCED, driver));
    });
    providers.remove(provider);
    checkRequiredDrivers();
}
Also used : DriverEvent(org.onosproject.net.driver.DriverEvent)

Example 2 with DriverEvent

use of org.onosproject.net.driver.DriverEvent in project onos by opennetworkinglab.

the class DriverRegistryManager method registerProvider.

@Override
public void registerProvider(DriverProvider provider) {
    provider.getDrivers().forEach(driver -> {
        Driver d = addDriver(driver);
        driverByKey.put(key(driver.manufacturer(), driver.hwVersion(), driver.swVersion()), d);
        d.behaviours().forEach(b -> {
            Class<? extends Behaviour> implementation = d.implementation(b);
            classes.put(b.getName(), b);
            classes.put(implementation.getName(), implementation);
        });
        post(new DriverEvent(DRIVER_ENHANCED, driver));
    });
    providers.add(provider);
    checkRequiredDrivers();
}
Also used : DriverEvent(org.onosproject.net.driver.DriverEvent) Driver(org.onosproject.net.driver.Driver)

Aggregations

DriverEvent (org.onosproject.net.driver.DriverEvent)2 Driver (org.onosproject.net.driver.Driver)1