Class PhasedRecoveryManager

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void activate​(org.osgi.service.component.ComponentContext context)  
      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.
      protected void deactivate()  
      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.
      protected void modified​(org.osgi.service.component.ComponentContext context)  
      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.
    • Constructor Detail

      • PhasedRecoveryManager

        public PhasedRecoveryManager()
    • Method Detail

      • activate

        protected void activate​(org.osgi.service.component.ComponentContext context)
      • deactivate

        protected void deactivate()
      • modified

        protected void modified​(org.osgi.service.component.ComponentContext context)
      • init

        public boolean init​(org.onosproject.net.DeviceId deviceId)
        Description copied from interface: PhasedRecoveryService
        Initializes a device. Only the instance leading the programming of the device is allowed to do this.
        Specified by:
        init in interface PhasedRecoveryService
        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

        public boolean reset​(org.onosproject.net.DeviceId deviceId)
        Description copied from interface: PhasedRecoveryService
        Resets a device. Only the instance leading the programming of the device is allowed to do this.
        Specified by:
        reset in interface PhasedRecoveryService
        Parameters:
        deviceId - device ID
        Returns:
        true if the device is reset successfully. false if the device has not been previously initialized.
      • getPhase

        public Phase getPhase​(org.onosproject.net.DeviceId deviceId)
        Description copied from interface: PhasedRecoveryService
        Gets recovery phase of given device.
        Specified by:
        getPhase in interface PhasedRecoveryService
        Parameters:
        deviceId - device ID
        Returns:
        current phase or null if the device wasn't seen before
      • setPhase

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

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

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

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

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