Search in sources :

Example 16 with DefaultDriverHandler

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);
}
Also used : DefaultDriverData(org.onosproject.net.driver.DefaultDriverData) DriverData(org.onosproject.net.driver.DriverData) DefaultDriverHandler(org.onosproject.net.driver.DefaultDriverHandler) Driver(org.onosproject.net.driver.Driver) DefaultDriverData(org.onosproject.net.driver.DefaultDriverData)

Example 17 with DefaultDriverHandler

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;
}
Also used : DefaultDriverHandler(org.onosproject.net.driver.DefaultDriverHandler) DriverHandler(org.onosproject.net.driver.DriverHandler) DefaultDriverHandler(org.onosproject.net.driver.DefaultDriverHandler) Driver(org.onosproject.net.driver.Driver) DefaultDriverData(org.onosproject.net.driver.DefaultDriverData)

Example 18 with DefaultDriverHandler

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;
}
Also used : DeviceId(org.onosproject.net.DeviceId) DefaultDriverHandler(org.onosproject.net.driver.DefaultDriverHandler) DriverHandler(org.onosproject.net.driver.DriverHandler) DefaultDriverHandler(org.onosproject.net.driver.DefaultDriverHandler) Driver(org.onosproject.net.driver.Driver) DefaultDriverData(org.onosproject.net.driver.DefaultDriverData)

Aggregations

DefaultDriverData (org.onosproject.net.driver.DefaultDriverData)18 DefaultDriverHandler (org.onosproject.net.driver.DefaultDriverHandler)18 Driver (org.onosproject.net.driver.Driver)13 DriverHandler (org.onosproject.net.driver.DriverHandler)8 DeviceId (org.onosproject.net.DeviceId)5 ItemNotFoundException (org.onlab.util.ItemNotFoundException)3 DriverData (org.onosproject.net.driver.DriverData)3 ArrayList (java.util.ArrayList)2 ExtensionTreatmentResolver (org.onosproject.net.behaviour.ExtensionTreatmentResolver)2 DeviceDescriptionDiscovery (org.onosproject.net.device.DeviceDescriptionDiscovery)2 DriverService (org.onosproject.net.driver.DriverService)2 Beta (com.google.common.annotations.Beta)1 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 EnumSet (java.util.EnumSet)1 List (java.util.List)1 Optional (java.util.Optional)1 Set (java.util.Set)1 ExecutorService (java.util.concurrent.ExecutorService)1 Executors.newSingleThreadExecutor (java.util.concurrent.Executors.newSingleThreadExecutor)1