@Singleton public class CloudInstanceConfig extends PropertiesInstanceConfig implements RefreshableInstanceConfig
InstanceInfo
configuration for AWS cloud deployments.
The information required for registration with eureka by a combination of
user-supplied values as well as querying AWS instance metadata.An utility
class AmazonInfo
helps in retrieving AWS specific values. Some of
that information including availability zone is used for determining
which eureka server to communicate to.
configInstance, namespace
DEFAULT_NAMESPACE
Constructor and Description |
---|
CloudInstanceConfig() |
CloudInstanceConfig(java.lang.String namespace) |
Modifier and Type | Method and Description |
---|---|
DataCenterInfo |
getDataCenterInfo()
Returns the data center this instance is deployed.
|
java.lang.String[] |
getDefaultAddressResolutionOrder()
An instance's network addresses should be fully expressed in it's
DataCenterInfo . |
java.lang.String |
getHostName(boolean refresh)
Gets the hostname associated with this instance.
|
java.lang.String |
getIpAddress()
Get the IPAdress of the instance.
|
void |
refreshAmazonInfo()
Deprecated.
2016-09-07
Refresh instance info - currently only used when in AWS cloud
as a public ip can change whenever an EIP is associated or dissociated.
|
java.lang.String |
resolveDefaultAddress()
Deprecated.
|
java.lang.String |
resolveDefaultAddress(boolean refresh)
resolve the default address
|
getAppGroupName, getAppname, getASGName, getHealthCheckUrl, getHealthCheckUrlPath, getHomePageUrl, getHomePageUrlPath, getInstanceId, getLeaseExpirationDurationInSeconds, getLeaseRenewalIntervalInSeconds, getMetadataMap, getNamespace, getNonSecurePort, getSecureHealthCheckUrl, getSecurePort, getSecurePortEnabled, getSecureVirtualHostName, getStatusPageUrl, getStatusPageUrlPath, getVirtualHostName, isInstanceEnabledOnit, isNonSecurePortEnabled, shouldBroadcastPublicIpv4Addr
public CloudInstanceConfig()
public CloudInstanceConfig(java.lang.String namespace)
@Deprecated public java.lang.String resolveDefaultAddress()
resolveDefaultAddress(boolean)
public java.lang.String resolveDefaultAddress(boolean refresh)
RefreshableInstanceConfig
resolveDefaultAddress
in interface RefreshableInstanceConfig
public java.lang.String getHostName(boolean refresh)
EurekaInstanceConfig
getHostName
in interface EurekaInstanceConfig
getHostName
in class AbstractInstanceConfig
refresh
- true if the information needs to be refetched, false
otherwise.public java.lang.String getIpAddress()
EurekaInstanceConfig
EurekaInstanceConfig.getHostName(boolean)
.getIpAddress
in interface EurekaInstanceConfig
getIpAddress
in class PropertiesInstanceConfig
public DataCenterInfo getDataCenterInfo()
EurekaInstanceConfig
getDataCenterInfo
in interface EurekaInstanceConfig
getDataCenterInfo
in class AbstractInstanceConfig
public java.lang.String[] getDefaultAddressResolutionOrder()
EurekaInstanceConfig
DataCenterInfo
.
For example for instances in AWS, this will include the publicHostname, publicIp,
privateHostname and privateIp, when available. The InstanceInfo
will further express a "default address", which is a field that can be configured by the
registering instance to advertise it's default address. This configuration allowed
for the expression of an ordered list of fields that can be used to resolve the default
address. The exact field values will depend on the implementation details of the corresponding
implementing DataCenterInfo types.getDefaultAddressResolutionOrder
in interface EurekaInstanceConfig
getDefaultAddressResolutionOrder
in class PropertiesInstanceConfig
@Deprecated public void refreshAmazonInfo()