@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, namespaceDEFAULT_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, shouldBroadcastPublicIpv4Addrpublic CloudInstanceConfig()
public CloudInstanceConfig(java.lang.String namespace)
@Deprecated public java.lang.String resolveDefaultAddress()
resolveDefaultAddress(boolean)public java.lang.String resolveDefaultAddress(boolean refresh)
RefreshableInstanceConfigresolveDefaultAddress in interface RefreshableInstanceConfigpublic java.lang.String getHostName(boolean refresh)
EurekaInstanceConfiggetHostName in interface EurekaInstanceConfiggetHostName in class AbstractInstanceConfigrefresh - true if the information needs to be refetched, false
otherwise.public java.lang.String getIpAddress()
EurekaInstanceConfigEurekaInstanceConfig.getHostName(boolean).getIpAddress in interface EurekaInstanceConfiggetIpAddress in class PropertiesInstanceConfigpublic DataCenterInfo getDataCenterInfo()
EurekaInstanceConfiggetDataCenterInfo in interface EurekaInstanceConfiggetDataCenterInfo in class AbstractInstanceConfigpublic java.lang.String[] getDefaultAddressResolutionOrder()
EurekaInstanceConfigDataCenterInfo.
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 EurekaInstanceConfiggetDefaultAddressResolutionOrder in class PropertiesInstanceConfig@Deprecated public void refreshAmazonInfo()