Interface ToggleMonitorManager
-
@ProviderType public interface ToggleMonitorManager
This component allowsToggleMonitor
s 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 aToggleRouter
of the feature toggle state.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deregisterMonitor(ToggleMonitor toggleMonitor, java.lang.String toggleName)
Remove the registration for the providedToggleMonitor
for the provided feature toggle, if such a registration exists.java.util.Collection<ToggleMonitor>
getRegisteredMonitors(java.lang.String toggleName)
Returns a collection of allToggleMonitor
s registered for a specific toggle name.void
registerMonitor(ToggleMonitor toggleMonitor, java.lang.String toggleName)
Register aToggleMonitor
to be notified when the specified feature toggle is updated by the ToggleMonitorManager.
-
-
-
Method Detail
-
registerMonitor
void registerMonitor(ToggleMonitor toggleMonitor, java.lang.String toggleName)
Register aToggleMonitor
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 registertoggleName
- feature toggle name to register for
-
deregisterMonitor
void deregisterMonitor(ToggleMonitor toggleMonitor, java.lang.String toggleName)
Remove the registration for the providedToggleMonitor
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 deregistertoggleName
- feature toggle name to deregister for
-
getRegisteredMonitors
java.util.Collection<ToggleMonitor> getRegisteredMonitors(java.lang.String toggleName)
Returns a collection of allToggleMonitor
s 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
-
-