Package com.hsbc.cranker.mucranker
Interface DarkHost
-
public interface DarkHostA host that does not have requests forwarded to it.Putting a host in dark mode is useful when needing to take a host out of an environment temporarily, e.g. for patching etc.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description InetAddressaddress()static DarkHostcreate(InetAddress address, Instant dateEnabled, String reason)Creates a new dark hostInstantdateEnabled()Stringreason()An optional description of why this host is in dark mode.booleansameHost(InetAddress address)Returns true if the given address matches this hostMap<String,Object>toMap()Creates a map object holding the address, date and reason.
-
-
-
Method Detail
-
address
InetAddress address()
- Returns:
- The address of the host
-
dateEnabled
Instant dateEnabled()
- Returns:
- Returns the time that dark mode was turned on for this host
-
reason
String reason()
An optional description of why this host is in dark mode.- Returns:
- A human-readable string, or null.
-
create
static DarkHost create(InetAddress address, Instant dateEnabled, String reason)
Creates a new dark host- Parameters:
address- The address of the host, for exampleInetAddress.getByName("127.0.0.1")dateEnabled- The date it was disabledreason- An optional reason of why this was enabled- Returns:
- A new DarkHost object
-
sameHost
boolean sameHost(InetAddress address)
Returns true if the given address matches this host- Parameters:
address- A host to check- Returns:
- True if the address is the same (generally if the IP addresses match)
-
-