@Introspected public class InstanceInfo extends Object implements ConfigurableInstanceInfo
Based on https://github.com/Netflix/eureka/blob/master/eureka-client/src/main/java/com/netflix/appinfo/InstanceInfo.java
Modifier and Type | Class and Description |
---|---|
static class |
InstanceInfo.Status
The instance status according to Eureka.
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_COUNTRY_ID
US by default.
|
static int |
DEFAULT_PORT
Eureka default port.
|
static int |
DEFAULT_SECURE_PORT
Secure port disabled by default.
|
Constructor and Description |
---|
InstanceInfo(String host,
int port,
@NotBlank String appName,
@NotBlank String instanceId)
Creates an
InstanceInfo . |
InstanceInfo(String host,
int port,
String ipAddress,
String appName,
String instanceId)
Creates an
InstanceInfo . |
InstanceInfo(String host,
@NotBlank String appName)
Creates an
InstanceInfo . |
InstanceInfo(String host,
@NotBlank String appName,
@NotBlank String instanceId)
Creates an
InstanceInfo . |
Modifier and Type | Method and Description |
---|---|
@NotBlank String |
getApp()
The application name.
|
String |
getAppGroupName()
The application group name.
|
String |
getAsgName() |
@Min(value=1L) int |
getCountryId()
The country id.
|
@NotNull DataCenterInfo |
getDataCenterInfo()
The
DataCenterInfo instance. |
String |
getHealthCheckUrl() |
String |
getHomePageUrl() |
@NotBlank String |
getHostName()
The host name of the application instance.
|
String |
getId()
Returns the unique id of the instance.
|
@NotBlank String |
getInstanceId()
The instance id.
|
@NotBlank String |
getIpAddr()
The IP address of the instance.
|
LeaseInfo |
getLeaseInfo()
The
LeaseInfo instance. |
Map<String,String> |
getMetadata() |
int |
getPort()
The port of the application instance.
|
io.micronaut.discovery.eureka.client.v2.InstanceInfo.PortWrapper |
getPortWrapper() |
String |
getSecureHealthCheckUrl() |
int |
getSecurePort()
The secure port of the application instance.
|
io.micronaut.discovery.eureka.client.v2.InstanceInfo.PortWrapper |
getSecurePortWrapper() |
@NotBlank String |
getSecureVipAddress() |
@NotNull InstanceInfo.Status |
getStatus() |
String |
getStatusPageUrl() |
@NotBlank String |
getVipAddress() |
void |
setAppGroupName(String appGroupName)
Sets the application group name.
|
void |
setAsgName(String asgName)
Sets the Amazon auto scaling group name to use.
|
void |
setCountryId(int countryId)
Sets the country id.
|
void |
setDataCenterInfo(DataCenterInfo dataCenterInfo)
Sets the
DataCenterInfo . |
void |
setHealthCheckUrl(String healthCheckUrl)
Sets the health check URL.
|
void |
setHomePageUrl(String homePageUrl)
Sets the home page URL.
|
void |
setInstanceId(String instanceId)
Sets the instance ID.
|
void |
setIpAddr(String ipAddr)
Sets the IP address of the instance.
|
void |
setLeaseInfo(LeaseInfo leaseInfo)
Sets the
LeaseInfo . |
void |
setMetadata(Map<String,String> metadata) |
void |
setPort(int port)
Sets the port of the application instance.
|
void |
setSecureHealthCheckUrl(String secureHealthCheckUrl)
Sets the secure health check URL.
|
void |
setSecurePort(int securePort)
Sets the secure port of the application instance.
|
void |
setSecureVipAddress(String secureVipAddress)
Sets the Secure Virtual Host Address.
|
void |
setStatus(InstanceInfo.Status status)
Sets the application status.
|
void |
setStatusPageUrl(String statusPageUrl)
Sets the status page URL.
|
void |
setVipAddress(String vipAddress)
Sets the Virtual Host Address.
|
String |
toString() |
public static final int DEFAULT_PORT
public static final int DEFAULT_SECURE_PORT
public static final int DEFAULT_COUNTRY_ID
public InstanceInfo(String host, @NotBlank @NotBlank String appName, @NotBlank @NotBlank String instanceId)
InstanceInfo
.host
- The host nameappName
- The application nameinstanceId
- The instance identifierpublic InstanceInfo(String host, @NotBlank @NotBlank String appName)
InstanceInfo
. The getInstanceId()
will default to the value of the hosthost
- The host nameappName
- The application namepublic InstanceInfo(String host, int port, @NotBlank @NotBlank String appName, @NotBlank @NotBlank String instanceId)
InstanceInfo
. This constructor will perform an IP Address lookup based on the host namehost
- The host nameport
- The portappName
- The application nameinstanceId
- The instance identifierpublic InstanceInfo(String host, int port, String ipAddress, String appName, String instanceId)
InstanceInfo
.host
- The host nameport
- The portipAddress
- The IP addressappName
- The application nameinstanceId
- The instance identifier@NotBlank public @NotBlank String getHostName()
getHostName
in interface ConfigurableInstanceInfo
public String getId()
getId
in interface ConfigurableInstanceInfo
public int getPort()
getPort
in interface ConfigurableInstanceInfo
public int getSecurePort()
getSecurePort
in interface ConfigurableInstanceInfo
public io.micronaut.discovery.eureka.client.v2.InstanceInfo.PortWrapper getPortWrapper()
public io.micronaut.discovery.eureka.client.v2.InstanceInfo.PortWrapper getSecurePortWrapper()
public void setSecurePort(int securePort)
ConfigurableInstanceInfo
setSecurePort
in interface ConfigurableInstanceInfo
securePort
- The secure port of the application instancepublic void setPort(int port)
ConfigurableInstanceInfo
setPort
in interface ConfigurableInstanceInfo
port
- The port of the application instance@NotBlank public @NotBlank String getApp()
getApp
in interface ConfigurableInstanceInfo
public String getAppGroupName()
getAppGroupName
in interface ConfigurableInstanceInfo
@NotBlank public @NotBlank String getInstanceId()
getInstanceId
in interface ConfigurableInstanceInfo
@Min(value=1L) public @Min(value=1L) int getCountryId()
getCountryId
in interface ConfigurableInstanceInfo
@NotBlank public @NotBlank String getIpAddr()
getIpAddr
in interface ConfigurableInstanceInfo
@NotNull public @NotNull InstanceInfo.Status getStatus()
getStatus
in interface ConfigurableInstanceInfo
@NotNull public @NotNull DataCenterInfo getDataCenterInfo()
DataCenterInfo
instance.getDataCenterInfo
in interface ConfigurableInstanceInfo
public LeaseInfo getLeaseInfo()
LeaseInfo
instance.getLeaseInfo
in interface ConfigurableInstanceInfo
public Map<String,String> getMetadata()
getMetadata
in interface ConfigurableInstanceInfo
public String getStatusPageUrl()
getStatusPageUrl
in interface ConfigurableInstanceInfo
public String getHomePageUrl()
getHomePageUrl
in interface ConfigurableInstanceInfo
public String getHealthCheckUrl()
getHealthCheckUrl
in interface ConfigurableInstanceInfo
@NotBlank public @NotBlank String getVipAddress()
getVipAddress
in interface ConfigurableInstanceInfo
@NotBlank public @NotBlank String getSecureVipAddress()
getSecureVipAddress
in interface ConfigurableInstanceInfo
public String getSecureHealthCheckUrl()
getSecureHealthCheckUrl
in interface ConfigurableInstanceInfo
public String getAsgName()
getAsgName
in interface ConfigurableInstanceInfo
public void setInstanceId(String instanceId)
setInstanceId
in interface ConfigurableInstanceInfo
instanceId
- The instance IDpublic void setAsgName(String asgName)
ConfigurableInstanceInfo
setAsgName
in interface ConfigurableInstanceInfo
asgName
- The Amazon auto scaling group name to usepublic void setHomePageUrl(String homePageUrl)
ConfigurableInstanceInfo
setHomePageUrl
in interface ConfigurableInstanceInfo
homePageUrl
- The home page URLpublic void setLeaseInfo(LeaseInfo leaseInfo)
ConfigurableInstanceInfo
LeaseInfo
.setLeaseInfo
in interface ConfigurableInstanceInfo
leaseInfo
- The LeaseInfo
public void setCountryId(int countryId)
ConfigurableInstanceInfo
setCountryId
in interface ConfigurableInstanceInfo
countryId
- The country idpublic void setStatusPageUrl(String statusPageUrl)
ConfigurableInstanceInfo
setStatusPageUrl
in interface ConfigurableInstanceInfo
statusPageUrl
- The status page URLpublic void setHealthCheckUrl(String healthCheckUrl)
ConfigurableInstanceInfo
setHealthCheckUrl
in interface ConfigurableInstanceInfo
healthCheckUrl
- The health check URLpublic void setSecureHealthCheckUrl(String secureHealthCheckUrl)
ConfigurableInstanceInfo
setSecureHealthCheckUrl
in interface ConfigurableInstanceInfo
secureHealthCheckUrl
- The secure health check URLpublic void setDataCenterInfo(DataCenterInfo dataCenterInfo)
ConfigurableInstanceInfo
DataCenterInfo
.setDataCenterInfo
in interface ConfigurableInstanceInfo
dataCenterInfo
- The DataCenterInfo
public void setStatus(InstanceInfo.Status status)
ConfigurableInstanceInfo
setStatus
in interface ConfigurableInstanceInfo
status
- The application statuspublic void setAppGroupName(String appGroupName)
ConfigurableInstanceInfo
setAppGroupName
in interface ConfigurableInstanceInfo
appGroupName
- The application group namepublic void setIpAddr(String ipAddr)
ConfigurableInstanceInfo
setIpAddr
in interface ConfigurableInstanceInfo
ipAddr
- The IP address of the instancepublic void setVipAddress(String vipAddress)
ConfigurableInstanceInfo
setVipAddress
in interface ConfigurableInstanceInfo
vipAddress
- The Virtual Host Addresspublic void setSecureVipAddress(String secureVipAddress)
ConfigurableInstanceInfo
setSecureVipAddress
in interface ConfigurableInstanceInfo
secureVipAddress
- The Secure Virtual Host Address