Interface PhasedRecoveryService

  • All Known Implementing Classes:
    PhasedRecoveryManager

    public interface PhasedRecoveryService
    Service that provides functionality related to phased recovery.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int EDGE_TIMEOUT
      Timeout for EDGE phase in seconds.
      static int INFRA_TIMEOUT
      Timeout for INFRA phase in seconds.
      static int PAIR_TIMEOUT
      Timeout for PAIR phase in seconds.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Set<org.onosproject.net.PortNumber> changeAllPorts​(org.onosproject.net.DeviceId deviceId, boolean enabled)
      Enables every ports on the given device.
      Set<org.onosproject.net.PortNumber> changeEdgePorts​(org.onosproject.net.DeviceId deviceId, boolean enabled)
      Enables edge ports on the given device.
      Set<org.onosproject.net.PortNumber> changeInfraPorts​(org.onosproject.net.DeviceId deviceId, boolean enabled)
      Enables infrastructure ports on the given device.
      Set<org.onosproject.net.PortNumber> changePairPort​(org.onosproject.net.DeviceId deviceId, boolean enabled)
      Enables pair port on the given device.
      Phase getPhase​(org.onosproject.net.DeviceId deviceId)
      Gets recovery phase of given device.
      Map<org.onosproject.net.DeviceId,​Phase> getPhases()
      Gets recovery phase of every devices.
      boolean init​(org.onosproject.net.DeviceId deviceId)
      Initializes a device.
      boolean isEnabled()
      Returns true if phased recovery is enabled.
      boolean reset​(org.onosproject.net.DeviceId deviceId)
      Resets a device.
      Phase setPhase​(org.onosproject.net.DeviceId deviceId, Phase newPhase)
      Sets given device with given recovery phase.
    • Field Detail

      • PAIR_TIMEOUT

        static final int PAIR_TIMEOUT
        Timeout for PAIR phase in seconds.
        See Also:
        Constant Field Values
      • INFRA_TIMEOUT

        static final int INFRA_TIMEOUT
        Timeout for INFRA phase in seconds.
        See Also:
        Constant Field Values
      • EDGE_TIMEOUT

        static final int EDGE_TIMEOUT
        Timeout for EDGE phase in seconds.
        See Also:
        Constant Field Values
    • Method Detail

      • isEnabled

        boolean isEnabled()
        Returns true if phased recovery is enabled.
        Returns:
        true if phased recovery is enabled.
      • init

        boolean init​(org.onosproject.net.DeviceId deviceId)
        Initializes a device. Only the instance leading the programming of the device is allowed to do this.
        Parameters:
        deviceId - device ID
        Returns:
        true if the device is initialized successfully and the caller should proceed, false if the device initialization has failed and the caller should abort.
      • reset

        boolean reset​(org.onosproject.net.DeviceId deviceId)
        Resets a device. Only the instance leading the programming of the device is allowed to do this.
        Parameters:
        deviceId - device ID
        Returns:
        true if the device is reset successfully. false if the device has not been previously initialized.
      • getPhases

        Map<org.onosproject.net.DeviceId,​Phase> getPhases()
        Gets recovery phase of every devices.
        Returns:
        a map between device ID and recovery phase
      • getPhase

        Phase getPhase​(org.onosproject.net.DeviceId deviceId)
        Gets recovery phase of given device.
        Parameters:
        deviceId - device ID
        Returns:
        current phase or null if the device wasn't seen before
      • setPhase

        Phase setPhase​(org.onosproject.net.DeviceId deviceId,
                       Phase newPhase)
        Sets given device with given recovery phase. Only the instance leading the programming of the device is allowed to do this.
        Parameters:
        deviceId - device ID
        newPhase - recovery phase
        Returns:
        new phase if transition succeeded, otherwise return current phase.
      • changeAllPorts

        Set<org.onosproject.net.PortNumber> changeAllPorts​(org.onosproject.net.DeviceId deviceId,
                                                           boolean enabled)
        Enables every ports on the given device.
        Parameters:
        deviceId - device id
        enabled - true to enable, false to disable
        Returns:
        ports that have been enabled
      • changePairPort

        Set<org.onosproject.net.PortNumber> changePairPort​(org.onosproject.net.DeviceId deviceId,
                                                           boolean enabled)
        Enables pair port on the given device.
        Parameters:
        deviceId - device id
        enabled - true to enable, false to disable
        Returns:
        ports that have been enabled
      • changeInfraPorts

        Set<org.onosproject.net.PortNumber> changeInfraPorts​(org.onosproject.net.DeviceId deviceId,
                                                             boolean enabled)
        Enables infrastructure ports on the given device.
        Parameters:
        deviceId - device id
        enabled - true to enable, false to disable
        Returns:
        ports that have been enabled
      • changeEdgePorts

        Set<org.onosproject.net.PortNumber> changeEdgePorts​(org.onosproject.net.DeviceId deviceId,
                                                            boolean enabled)
        Enables edge ports on the given device.
        Parameters:
        deviceId - device id
        enabled - true to enable, false to disable
        Returns:
        ports that have been enabled