Package com.netflix.appinfo
Class CloudInstanceConfig
- java.lang.Object
-
- com.netflix.appinfo.AbstractInstanceConfig
-
- com.netflix.appinfo.PropertiesInstanceConfig
-
- com.netflix.appinfo.CloudInstanceConfig
-
- All Implemented Interfaces:
EurekaInstanceConfig,RefreshableInstanceConfig
@Singleton public class CloudInstanceConfig extends PropertiesInstanceConfig implements RefreshableInstanceConfig
AnInstanceInfoconfiguration 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
AmazonInfohelps in retrieving AWS specific values. Some of that information including availability zone is used for determining which eureka server to communicate to.
-
-
Field Summary
-
Fields inherited from class com.netflix.appinfo.PropertiesInstanceConfig
configInstance, namespace
-
Fields inherited from class com.netflix.appinfo.AbstractInstanceConfig
DEFAULT_NAMESPACE
-
-
Constructor Summary
Constructors Constructor Description CloudInstanceConfig()CloudInstanceConfig(java.lang.String namespace)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DataCenterInfogetDataCenterInfo()Returns the data center this instance is deployed.java.lang.String[]getDefaultAddressResolutionOrder()An instance's network addresses should be fully expressed in it'sDataCenterInfo.java.lang.StringgetHostName(boolean refresh)Gets the hostname associated with this instance.java.lang.StringgetIpAddress()Get the IPAdress of the instance.voidrefreshAmazonInfo()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.StringresolveDefaultAddress()Deprecated.java.lang.StringresolveDefaultAddress(boolean refresh)resolve the default address-
Methods inherited from class com.netflix.appinfo.PropertiesInstanceConfig
getAppGroupName, getAppname, getASGName, getHealthCheckUrl, getHealthCheckUrlPath, getHomePageUrl, getHomePageUrlPath, getInstanceId, getLeaseExpirationDurationInSeconds, getLeaseRenewalIntervalInSeconds, getMetadataMap, getNamespace, getNonSecurePort, getSecureHealthCheckUrl, getSecurePort, getSecurePortEnabled, getSecureVirtualHostName, getStatusPageUrl, getStatusPageUrlPath, getVirtualHostName, isInstanceEnabledOnit, isNonSecurePortEnabled, shouldBroadcastPublicIpv4Addr
-
-
-
-
Method Detail
-
resolveDefaultAddress
@Deprecated public java.lang.String resolveDefaultAddress()
Deprecated.
-
resolveDefaultAddress
public java.lang.String resolveDefaultAddress(boolean refresh)
Description copied from interface:RefreshableInstanceConfigresolve the default address- Specified by:
resolveDefaultAddressin interfaceRefreshableInstanceConfig- Returns:
-
getHostName
public java.lang.String getHostName(boolean refresh)
Description copied from interface:EurekaInstanceConfigGets the hostname associated with this instance. This is the exact name that would be used by other instances to make calls.- Specified by:
getHostNamein interfaceEurekaInstanceConfig- Overrides:
getHostNamein classAbstractInstanceConfig- Parameters:
refresh- true if the information needs to be refetched, false otherwise.- Returns:
- hostname of this instance which is identifiable by other instances for making remote calls.
-
getIpAddress
public java.lang.String getIpAddress()
Description copied from interface:EurekaInstanceConfigGet the IPAdress of the instance. This information is for academic purposes only as the communication from other instances primarily happen using the information supplied inEurekaInstanceConfig.getHostName(boolean).- Specified by:
getIpAddressin interfaceEurekaInstanceConfig- Overrides:
getIpAddressin classPropertiesInstanceConfig- Returns:
- the ip address of this instance.
-
getDataCenterInfo
public DataCenterInfo getDataCenterInfo()
Description copied from interface:EurekaInstanceConfigReturns the data center this instance is deployed. This information is used to get some AWS specific instance information if the instance is deployed in AWS.- Specified by:
getDataCenterInfoin interfaceEurekaInstanceConfig- Overrides:
getDataCenterInfoin classAbstractInstanceConfig- Returns:
- information that indicates which data center this instance is deployed in.
-
getDefaultAddressResolutionOrder
public java.lang.String[] getDefaultAddressResolutionOrder()
Description copied from interface:EurekaInstanceConfigAn instance's network addresses should be fully expressed in it'sDataCenterInfo. For example for instances in AWS, this will include the publicHostname, publicIp, privateHostname and privateIp, when available. TheInstanceInfowill 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.- Specified by:
getDefaultAddressResolutionOrderin interfaceEurekaInstanceConfig- Overrides:
getDefaultAddressResolutionOrderin classPropertiesInstanceConfig- Returns:
- an ordered list of fields that should be used to preferentially resolve this instance's default address, empty String[] for default.
-
refreshAmazonInfo
@Deprecated public 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.
-
-