Class SingleIpHttpClient
java.lang.Object
com.github.nhenneaux.resilienthttpclient.monitoredclientpool.SingleIpHttpClient
- All Implemented Interfaces:
AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionSingleIpHttpClient(HttpClient httpClient, InetAddress inetAddress, ServerConfiguration serverConfiguration) Create a new instance and check its health once.SingleIpHttpClient(HttpClient httpClient, InetAddress inetAddress, ServerConfiguration serverConfiguration, ScheduledExecutorService scheduledExecutorService) Create a new instance of the client and schedule a task to refresh is healthiness. -
Method Summary
-
Constructor Details
-
SingleIpHttpClient
public SingleIpHttpClient(HttpClient httpClient, InetAddress inetAddress, ServerConfiguration serverConfiguration, ScheduledExecutorService scheduledExecutorService) Create a new instance of the client and schedule a task to refresh is healthiness.- Parameters:
httpClient- the underlying HTTP clientinetAddress- the target IP addressserverConfiguration- the configuration of the serverscheduledExecutorService- the scheduled executor service to schedule the refresh.
-
SingleIpHttpClient
public SingleIpHttpClient(HttpClient httpClient, InetAddress inetAddress, ServerConfiguration serverConfiguration) Create a new instance and check its health once.- Parameters:
httpClient- the underlying HTTP clientinetAddress- the target IP addressserverConfiguration- the configuration of the server
-
-
Method Details
-
isHealthy
public boolean isHealthy()If called and the previous health status was unhealthy, then a new health check is performed. -
getHttpClient
-
toString
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-