Package io.smallrye.health.checks
Class InetAddressHealthCheck
- java.lang.Object
-
- io.smallrye.health.checks.InetAddressHealthCheck
-
- All Implemented Interfaces:
org.eclipse.microprofile.health.HealthCheck
public class InetAddressHealthCheck extends Object implements org.eclipse.microprofile.health.HealthCheck
Health check implementation to check if host is reachable usingjava.net.InetAddress.isReachablemethod.@Produces @ApplicationScoped @Liveness HealthCheck check1() { return new InetAddressHealthCheck("service.com"); }- See Also:
InetAddress
-
-
Constructor Summary
Constructors Constructor Description InetAddressHealthCheck(String host)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.microprofile.health.HealthCheckResponsecall()InetAddressHealthCheckname(String name)Sets the name of the health check.InetAddressHealthChecktimeout(int timeout)Sets timeout in millis.
-
-
-
Constructor Detail
-
InetAddressHealthCheck
public InetAddressHealthCheck(String host)
-
-
Method Detail
-
call
public org.eclipse.microprofile.health.HealthCheckResponse call()
- Specified by:
callin interfaceorg.eclipse.microprofile.health.HealthCheck
-
timeout
public InetAddressHealthCheck timeout(int timeout)
Sets timeout in millis.- Parameters:
timeout- in millis.- Returns:
- InetAddressHealthCheck instance.
-
name
public InetAddressHealthCheck name(String name)
Sets the name of the health check.- Parameters:
name- of health check.- Returns:
- InetAddressHealthCheck instance.
-
-