Interface DeviceProvider

    • Method Detail

      • 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 identifier
        newRole - 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 identifier
        portNumber - port number
        enable - true if port is to be enabled, false to disable