Package org.onosproject.net.device
Interface DeviceProvider
-
- All Superinterfaces:
Provider
- All Known Implementing Classes:
AbstractDeviceProvider
public interface DeviceProvider extends Provider
Abstraction of a device information provider.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
changePortState(DeviceId deviceId, PortNumber portNumber, boolean enable)
Administratively enables or disables a port.default boolean
isAvailable(DeviceId deviceId)
Checks the availability of the device from the provider perspective.boolean
isReachable(DeviceId deviceId)
Checks the reachability (connectivity) of a device from this provider.void
roleChanged(DeviceId deviceId, MastershipRole newRole)
Notifies the provider of a mastership role change for the specified device as decided by the core.default void
triggerDisconnect(DeviceId deviceId)
Administratively triggers 'disconnection' from the device.void
triggerProbe(DeviceId deviceId)
Triggers an asynchronous probe of the specified device, intended to determine whether the device is present or not.
-
-
-
Method Detail
-
triggerProbe
void triggerProbe(DeviceId deviceId)
Triggers an asynchronous probe of the specified device, intended to determine whether the device is present or not. An indirect result of this should be invocation ofDeviceProviderService.deviceConnected(org.onosproject.net.DeviceId, org.onosproject.net.device.DeviceDescription)
)} orDeviceProviderService.deviceDisconnected(org.onosproject.net.DeviceId)
at some later point in time.- Parameters:
deviceId
- ID of device to be probed
-
roleChanged
void roleChanged(DeviceId deviceId, MastershipRole newRole)
Notifies the provider of a mastership role change for the specified device as decided by the core.- Parameters:
deviceId
- device identifiernewRole
- newly determined mastership role
-
isReachable
boolean isReachable(DeviceId deviceId)
Checks the reachability (connectivity) of a device from this provider. Reachability, unlike availability, denotes whether THIS particular node can send messages and receive replies from the specified device.Implementations are encouraged to check for reachability by using only internal provider state, i.e., without blocking execution.
- Parameters:
deviceId
- device identifier- Returns:
- true if reachable, false otherwise
-
isAvailable
default boolean isAvailable(DeviceId deviceId)
Checks the availability of the device from the provider perspective. Availability denotes whether the device is reachable by this node and able to perform its functions as expected (e.g., forward traffic).Implementations are encouraged to check for availability by using only internal provider state, i.e., without blocking execution.
- Parameters:
deviceId
- device identifier- Returns:
- completable future eventually true if available, false otherwise
-
changePortState
void changePortState(DeviceId deviceId, PortNumber portNumber, boolean enable)
Administratively enables or disables a port.- Parameters:
deviceId
- device identifierportNumber
- port numberenable
- true if port is to be enabled, false to disable
-
triggerDisconnect
default void triggerDisconnect(DeviceId deviceId)
Administratively triggers 'disconnection' from the device. This is meant purely in logical sense and is intended to apply equally to implementations relying on connectionless control protocols. An indirect result of this should be invocation ofDeviceProviderService.deviceDisconnected(org.onosproject.net.DeviceId)
if the device was presently 'connected' andDeviceProviderService.deviceConnected(org.onosproject.net.DeviceId, org.onosproject.net.device.DeviceDescription)
at some later point in time if the device is available and continues to be permitted to reconnect or if the provider continues to discover it.- Parameters:
deviceId
- device identifier
-
-