Package org.onosproject.net.driver
Interface DriverService
-
- All Superinterfaces:
DriverPrimordialResolver
,DriverRegistry
,DriverResolver
,ListenerService<DriverEvent,DriverListener>
public interface DriverService extends DriverRegistry
Service for obtaining drivers and driver behaviour implementations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DriverHandler
createHandler(DeviceId deviceId, java.lang.String... credentials)
Creates a new driver handler for interacting with the specified device.java.util.Map<DeviceId,java.lang.String>
getDeviceDrivers()
Returns a map between all devices and their driver names.Driver
getDriver(DeviceId deviceId)
Returns the driver for the specified device.java.util.Set<Driver>
getDrivers()
Returns the overall set of drivers being provided.java.util.Set<Driver>
getDrivers(java.lang.Class<? extends Behaviour> withBehaviour)
Returns the set of drivers which support the specified behaviour.-
Methods inherited from interface org.onosproject.net.driver.DriverPrimordialResolver
getDriver
-
Methods inherited from interface org.onosproject.net.driver.DriverResolver
getDriver
-
Methods inherited from interface org.onosproject.event.ListenerService
addListener, removeListener
-
-
-
-
Method Detail
-
getDrivers
java.util.Set<Driver> getDrivers()
Returns the overall set of drivers being provided.- Specified by:
getDrivers
in interfaceDriverRegistry
- Returns:
- provided drivers
-
getDrivers
java.util.Set<Driver> getDrivers(java.lang.Class<? extends Behaviour> withBehaviour)
Returns the set of drivers which support the specified behaviour.- Parameters:
withBehaviour
- behaviour class to query by- Returns:
- provided drivers
-
getDriver
Driver getDriver(DeviceId deviceId)
Returns the driver for the specified device. If the network configuration for the specified device carries thedriver
property or if the device carries thedriver
annotation, they will be used to look-up the driver, in respective order. Otherwise, the device manufacturer, hardware and software version attributes are used to look-up the driver. First using their literal values and if no driver is found, using ERE matching against the driver manufacturer, hardware and software version fields.- Parameters:
deviceId
- device identifier- Returns:
- driver or null of no matching one is found
- Throws:
ItemNotFoundException
- if device or driver for it are not found
-
getDeviceDrivers
java.util.Map<DeviceId,java.lang.String> getDeviceDrivers()
Returns a map between all devices and their driver names.- Returns:
- map of (device id, driver name)
-
createHandler
DriverHandler createHandler(DeviceId deviceId, java.lang.String... credentials)
Creates a new driver handler for interacting with the specified device. The driver is looked-up using the same semantics asgetDriver(DeviceId)
method.- Parameters:
deviceId
- device identifiercredentials
- optional login credentials in string form- Returns:
- driver handler
- Throws:
ItemNotFoundException
- if device or driver for it are not found
-
-