public abstract class RegistrationConfiguration extends Object implements Toggleable
ServiceInstance
registration.Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_DEREGISTER
The default deregister value.
|
static boolean |
DEFAULT_ENABLED
The default enable value.
|
static boolean |
DEFAULT_FAILFAST
The default fail fast value.
|
static int |
DEFAULT_RETRY_COUNT
The default retry count value.
|
static int |
DEFAULT_RETRYDELAY_SECONDS
The default retry delay in seconds.
|
static String |
PREFIX
The prefix to use for all client discovery registration settings.
|
Constructor and Description |
---|
RegistrationConfiguration() |
Modifier and Type | Method and Description |
---|---|
Optional<String> |
getHealthPath() |
Optional<String> |
getIpAddr()
The IP address to use to register.
|
int |
getRetryCount() |
Duration |
getRetryDelay() |
Optional<Duration> |
getTimeout() |
boolean |
isDeregister() |
boolean |
isEnabled() |
boolean |
isFailFast() |
boolean |
isPreferIpAddress()
Should the IP address by used to register with the discovery server.
|
void |
setDeregister(boolean deregister)
Default value (true).
|
void |
setEnabled(boolean enabled)
Default value (true).
|
void |
setFailFast(boolean failFast)
Default value (true).
|
void |
setHealthPath(String healthPath) |
void |
setIpAddr(String ipAddr)
The IP address to use to register.
|
void |
setPreferIpAddress(boolean preferIpAddress)
Sets whether the IP address by used to register with the discovery server.
|
void |
setRetryCount(int retryCount)
Default value (-1).
|
void |
setRetryDelay(Duration retryDelay)
Default value (1 seconds).
|
void |
setTimeout(Duration timeout) |
public static final String PREFIX
public static final boolean DEFAULT_ENABLED
public static final int DEFAULT_RETRY_COUNT
public static final int DEFAULT_RETRYDELAY_SECONDS
public static final boolean DEFAULT_DEREGISTER
public static final boolean DEFAULT_FAILFAST
public Optional<String> getIpAddr()
public void setIpAddr(@Nullable String ipAddr)
ipAddr
- The ip addresspublic boolean isPreferIpAddress()
public void setPreferIpAddress(boolean preferIpAddress)
preferIpAddress
- True if the IP address should be usedpublic void setTimeout(Duration timeout)
timeout
- The timeout for registrationpublic boolean isFailFast()
public void setFailFast(boolean failFast)
failFast
- Whether to fail server startup if registration failspublic boolean isDeregister()
public void setDeregister(boolean deregister)
deregister
- Whether to deregister the service on shutdownpublic boolean isEnabled()
isEnabled
in interface Toggleable
public void setEnabled(boolean enabled)
enabled
- Whether service registration is enabledpublic int getRetryCount()
public void setRetryCount(int retryCount)
retryCount
- The retry countpublic Duration getRetryDelay()
public void setRetryDelay(Duration retryDelay)
retryDelay
- The retry delaypublic void setHealthPath(String healthPath)
healthPath
- The health endpoint path