Package org.onosproject.net.driver
Class DefaultDriverProvider
- java.lang.Object
-
- org.onosproject.net.driver.DefaultDriverProvider
-
- All Implemented Interfaces:
DriverProvider
public class DefaultDriverProvider extends java.lang.Object implements DriverProvider
Default driver provider implementation.
-
-
Constructor Summary
Constructors Constructor Description DefaultDriverProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Driver
addDriver(Driver driver)
Adds the specified driver to the provider.void
addDrivers(java.util.Set<Driver> drivers)
Adds the specified drivers to the provider.java.util.Set<Driver>
getDrivers()
Returns the set of driver types and behaviour implementations to be made available by this provider.void
removeDriver(Driver driver)
Removes the specified driver from the provider.void
removeDrivers(java.util.Set<Driver> drivers)
Removes the specified drivers from the provider.java.lang.String
toString()
-
-
-
Field Detail
-
drivers
protected final java.util.Map<java.lang.String,Driver> drivers
-
-
Method Detail
-
getDrivers
public java.util.Set<Driver> getDrivers()
Description copied from interface:DriverProvider
Returns the set of driver types and behaviour implementations to be made available by this provider.- Specified by:
getDrivers
in interfaceDriverProvider
- Returns:
- set of driver types and their behaviours
-
addDrivers
public void addDrivers(java.util.Set<Driver> drivers)
Adds the specified drivers to the provider.- Parameters:
drivers
- drivers to be added
-
addDriver
public Driver addDriver(Driver driver)
Adds the specified driver to the provider. If a driver with the same does not exist yet, the specified one will be added. Otherwise, the existing driver will be merged with the new one and the result will be registered.- Parameters:
driver
- driver to be provided- Returns:
- registered driver
-
removeDrivers
public void removeDrivers(java.util.Set<Driver> drivers)
Removes the specified drivers from the provider.- Parameters:
drivers
- drivers to be removed
-
removeDriver
public void removeDriver(Driver driver)
Removes the specified driver from the provider.- Parameters:
driver
- driver to be removed
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-