Package com.hsbc.cranker.mucranker
Interface DarkModeManager
-
public interface DarkModeManagerThis class allows you to block certain hosts from receiving requests.
If a host is in "dark mode" then cranker connectors can still register with it, however no requests will be forwarded to those connectors.
You can acquire an instance of this class by creating a cranker router object and then calling
CrankerRouter.darkModeManager()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<DarkHost>darkHosts()The current dark hosts.voiddisableDarkMode(DarkHost host)Removes the target from the set of blocked hosts.voidenableDarkMode(DarkHost host)Specifies that the given target destination should not have any requests sent to it.Optional<DarkHost>findHost(InetAddress address)Finds the host associated with the given address, if it is in dark mode.
-
-
-
Method Detail
-
enableDarkMode
void enableDarkMode(DarkHost host)
Specifies that the given target destination should not have any requests sent to it.Does nothing if the host was already in dark mode.
- Parameters:
host- The host to block, created withDarkHost.create(InetAddress, Instant, String)
-
disableDarkMode
void disableDarkMode(DarkHost host)
Removes the target from the set of blocked hosts.Does nothing if the host was not already in dark mode.
- Parameters:
host- An IP address previously added toenableDarkMode(DarkHost)
-
darkHosts
Set<DarkHost> darkHosts()
The current dark hosts.- Returns:
- A readonly set of hosts that are currently in dark mode.
-
findHost
Optional<DarkHost> findHost(InetAddress address)
Finds the host associated with the given address, if it is in dark mode.- Parameters:
address- The address of the host, e.g.InetAddress.getByName("127.0.0.1")- Returns:
- The host if it is currently in dark mode; otherwise an empty optional object.
-
-