Package com.networknt.consul
Class ConsulRecoveryManager
- java.lang.Object
-
- com.networknt.consul.ConsulRecoveryManager
-
public class ConsulRecoveryManager extends Object
-
-
Constructor Summary
Constructors Constructor Description ConsulRecoveryManager(String serviceName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckin()booleanexitRecoveryMode()Exit Consul connection recovery modelonggetRecoveryAttempts()StringgetServiceName()static voidgracefulShutdown()Gracefully shuts down the host applicationbooleanisRecoveryMode()booleannewFailedAttempt()Record a new failed attempt to recover the Consul connectionvoidsetServiceName(String serviceName)
-
-
-
Constructor Detail
-
ConsulRecoveryManager
public ConsulRecoveryManager(String serviceName)
-
-
Method Detail
-
exitRecoveryMode
public boolean exitRecoveryMode()
Exit Consul connection recovery mode- Returns:
- the previous recovery mode state
-
newFailedAttempt
public boolean newFailedAttempt()
Record a new failed attempt to recover the Consul connection- Returns:
- true if additional failed attempts are permitted false if this new failed attempt was the last permitted attempt
-
gracefulShutdown
public static void gracefulShutdown()
Gracefully shuts down the host application
-
checkin
public void checkin()
-
isRecoveryMode
public boolean isRecoveryMode()
-
getRecoveryAttempts
public long getRecoveryAttempts()
-
getServiceName
public String getServiceName()
-
setServiceName
public void setServiceName(String serviceName)
-
-