Package org.onosproject.net.driver
Interface Driver
- 
- All Superinterfaces:
- Annotations
 - All Known Implementing Classes:
- DefaultDriver
 
 public interface Driver extends Annotations Representation of a specific family of device drivers. Behaviour configuration data is stored usingAnnotations.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description Set<Class<? extends Behaviour>>behaviours()Returns the set of behaviours supported by this driver.<T extends Behaviour>
 TcreateBehaviour(DriverData data, Class<T> behaviourClass)Creates an instance of behaviour primed with the specified driver data.<T extends Behaviour>
 TcreateBehaviour(DriverHandler handler, Class<T> behaviourClass)Creates an instance of behaviour primed with the specified driver handler.StringgetProperty(String name)Gets the value of given property name.default StringgetProperty(String name, String defaultValue)Gets the value of given property name.booleanhasBehaviour(Class<? extends Behaviour> behaviourClass)Indicates whether or not the driver, or any of its parents, support the specified class of behaviour.StringhwVersion()Returns the device hardware version.Class<? extends Behaviour>implementation(Class<? extends Behaviour> behaviour)Returns the implementation class for the specified behaviour.Stringmanufacturer()Returns the device manufacturer name.Drivermerge(Driver other)Merges the specified driver behaviours and properties into this one, giving preference to the other driver when dealing with conflicts.Stringname()Returns the driver name.Driverparent()Deprecated.1.5.0 Falcon ReleaseList<Driver>parents()Returns all the parent drivers from which this driver inherits behaviours and properties.Map<String,String>properties()Returns the set of annotations as map of key/value properties.StringswVersion()Returns the device software version.- 
Methods inherited from interface org.onosproject.net.Annotationskeys, value
 
- 
 
- 
- 
- 
Method Detail- 
nameString name() Returns the driver name. This is expected to be a reverse-DNS, Java package-like name.- Returns:
- driver name
 
 - 
parent@Deprecated Driver parent() Deprecated.1.5.0 Falcon ReleaseReturns the parent driver from which this driver inherits behaviours and properties.- Returns:
- parent driver; null if driver has no parent
 
 - 
parentsList<Driver> parents() Returns all the parent drivers from which this driver inherits behaviours and properties.- Returns:
- list of parent drivers
 
 - 
manufacturerString manufacturer() Returns the device manufacturer name.- Returns:
- manufacturer name
 
 - 
hwVersionString hwVersion() Returns the device hardware version.- Returns:
- hardware version
 
 - 
swVersionString swVersion() Returns the device software version.- Returns:
- software version
 
 - 
behavioursSet<Class<? extends Behaviour>> behaviours() Returns the set of behaviours supported by this driver. It reflects behaviours of only this driver and not its parent.- Returns:
- set of device driver behaviours
 
 - 
implementationClass<? extends Behaviour> implementation(Class<? extends Behaviour> behaviour) Returns the implementation class for the specified behaviour. It reflects behaviours of only this driver and not its parent.- Parameters:
- behaviour- behaviour interface
- Returns:
- implementation class
 
 - 
hasBehaviourboolean hasBehaviour(Class<? extends Behaviour> behaviourClass) Indicates whether or not the driver, or any of its parents, support the specified class of behaviour.- Parameters:
- behaviourClass- behaviour class
- Returns:
- true if behaviour is supported
 
 - 
createBehaviour<T extends Behaviour> T createBehaviour(DriverData data, Class<T> behaviourClass) Creates an instance of behaviour primed with the specified driver data. If the current driver does not support the specified behaviour and the driver has parent, the request is delegated to the parent driver.- Type Parameters:
- T- type of behaviour
- Parameters:
- data- driver data context
- behaviourClass- driver behaviour class
- Returns:
- behaviour instance
 
 - 
createBehaviour<T extends Behaviour> T createBehaviour(DriverHandler handler, Class<T> behaviourClass) Creates an instance of behaviour primed with the specified driver handler. If the current driver does not support the specified behaviour and the driver has parent, the request is delegated to the parent driver.- Type Parameters:
- T- type of behaviour
- Parameters:
- handler- driver handler context
- behaviourClass- driver behaviour class
- Returns:
- behaviour instance
 
 - 
propertiesMap<String,String> properties() Returns the set of annotations as map of key/value properties.- Returns:
- map of properties
 
 - 
getPropertyString getProperty(String name) Gets the value of given property name. If the driver does not define the property, a BFS will be performed to search its ancestors.- Parameters:
- name- property name
- Returns:
- the value of the property, or null if the property is not defined in this driver nor in any of its ancestors
 
 - 
getPropertydefault String getProperty(String name, String defaultValue) Gets the value of given property name. If the driver does not define the property, a BFS will be performed to search its ancestors.- Parameters:
- name- property name
- defaultValue- to use if the property is not defined in this driver nor in any of its ancestors
- Returns:
- the value of the property,
         or defaultValueif the property is not defined in this driver nor in any of its ancestors
 
 
- 
 
-