Interface ToggleMonitorManager


  • @ProviderType
    public interface ToggleMonitorManager
    This component allows ToggleMonitors to register to be notified of status checks on the feature toggle the monitor refers to. When those status checks occur, the monitors can then take appropriate action, for example to notify another component (perhaps one unaware of or unable to use a ToggleRouter of the feature toggle state.
    • Method Detail

      • registerMonitor

        void registerMonitor​(ToggleMonitor toggleMonitor,
                             java.lang.String toggleName)
        Register a ToggleMonitor to be notified when the specified feature toggle is updated by the ToggleMonitorManager. It is possible to register multiple monitors for the same feature toggle, in which case each monitor is notified when the status for that feature toggle is updated by the ToggleMonitorManager. It is also possible to register the same monitor for multiple feature toggles, in which case the monitor will be notified when the status changes for of any feature toggles for which it is registered.
        Parameters:
        toggleMonitor - monitor to register
        toggleName - feature toggle name to register for
      • deregisterMonitor

        void deregisterMonitor​(ToggleMonitor toggleMonitor,
                               java.lang.String toggleName)
        Remove the registration for the provided ToggleMonitor for the provided feature toggle, if such a registration exists. This means the ToggleMonitorManager will no longer notify the monitor of changes to the referenced feature toggle.
        Parameters:
        toggleMonitor - monitor to deregister
        toggleName - feature toggle name to deregister for
      • getRegisteredMonitors

        java.util.Collection<ToggleMonitor> getRegisteredMonitors​(java.lang.String toggleName)
        Returns a collection of all ToggleMonitors registered for a specific toggle name. An empty collection will be returned if no toggle monitors are registered for the provided name. The collection returned should be considered immutable. Implementations are recommended to return an immutable collection.
        Parameters:
        toggleName - name of the feature toggle to check
        Returns:
        collection of registered toggle monitors; empty if no toggle monitors are registered for this feature toggle