Package org.onosproject.net.driver
Interface DriverHandler
-
- All Known Implementing Classes:
DefaultDriverHandler
public interface DriverHandlerRepresentation of context for interacting with a device.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <T extends Behaviour>
Tbehaviour(Class<T> behaviourClass)Returns the specified facet of behaviour to interact with the device.DriverDatadata()Returns the device driver data.Driverdriver()Returns the parent device driver.<T> Tget(Class<T> serviceClass)Returns the reference to the implementation of the specified service.default booleanhasBehaviour(Class<? extends Behaviour> behaviourClass)Indicates whether or not the driver, or any of its parents, support the specified class of behaviour.
-
-
-
Method Detail
-
driver
Driver driver()
Returns the parent device driver.- Returns:
- device driver
-
data
DriverData data()
Returns the device driver data.- Returns:
- device driver data
-
behaviour
<T extends Behaviour> T behaviour(Class<T> behaviourClass)
Returns the specified facet of behaviour to interact with the device.- Type Parameters:
T- type of behaviour- Parameters:
behaviourClass- behaviour class- Returns:
- behaviour
-
hasBehaviour
default boolean 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
-
get
<T> T get(Class<T> serviceClass)
Returns the reference to the implementation of the specified service. Provides access to run-time context.- Type Parameters:
T- type of service- Parameters:
serviceClass- service class- Returns:
- service implementation
- Throws:
ServiceNotFoundException- if service is unavailable
-
-