Search in sources :

Example 31 with DriverService

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

the class DeviceDriversCommand method doExecute.

@Override
protected void doExecute() {
    DriverService service = get(DriverService.class);
    if (uri == null) {
        Map<DeviceId, String> deviceDriverNameMap = service.getDeviceDrivers();
        if (outputJson()) {
            json(deviceDriverNameMap);
        } else {
            deviceDriverNameMap.forEach((k, v) -> print("%s : %s", k.toString(), v));
        }
    } else {
        DeviceId deviceId = DeviceId.deviceId(uri);
        String driverName = service.getDriver(deviceId).name();
        if (outputJson()) {
            json(deviceId, driverName);
        } else {
            print("%s : %s", deviceId.toString(), driverName);
        }
    }
}
Also used : DeviceId(org.onosproject.net.DeviceId) DriverService(org.onosproject.net.driver.DriverService)

Example 32 with DriverService

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

the class DeviceInterfacesListCommand method doExecute.

@Override
protected void doExecute() {
    DeviceService deviceService = get(DeviceService.class);
    DriverService driverService = get(DriverService.class);
    if (uri == null) {
        // No specific device, so all devices will be examined.
        for (Device device : getSortedDevices(deviceService)) {
            printDevice(deviceService, driverService, device);
        }
    } else {
        Device device = deviceService.getDevice(deviceId(uri));
        printDevice(deviceService, driverService, device);
    }
}
Also used : Device(org.onosproject.net.Device) DeviceService(org.onosproject.net.device.DeviceService) DriverService(org.onosproject.net.driver.DriverService)

Aggregations

DriverService (org.onosproject.net.driver.DriverService)32 DriverHandler (org.onosproject.net.driver.DriverHandler)23 DeviceId (org.onosproject.net.DeviceId)9 DeviceService (org.onosproject.net.device.DeviceService)5 List (java.util.List)3 Set (java.util.Set)3 Tools.groupedThreads (org.onlab.util.Tools.groupedThreads)3 VoltOnuConfig (org.onosproject.drivers.fujitsu.behaviour.VoltOnuConfig)3 DefaultDriverData (org.onosproject.net.driver.DefaultDriverData)3 DefaultDriverHandler (org.onosproject.net.driver.DefaultDriverHandler)3 Driver (org.onosproject.net.driver.Driver)3 Beta (com.google.common.annotations.Beta)2 ImmutableSet (com.google.common.collect.ImmutableSet)2 Lists (com.google.common.collect.Lists)2 Maps (com.google.common.collect.Maps)2 Dictionary (java.util.Dictionary)2 Map (java.util.Map)2 Objects (java.util.Objects)2 Optional (java.util.Optional)2 ExecutorService (java.util.concurrent.ExecutorService)2