Package com.netflix.discovery.util
Class EurekaUtils
- java.lang.Object
-
- com.netflix.discovery.util.EurekaUtils
-
public final class EurekaUtils extends java.lang.ObjectA collection of utility functions that is useful to simplify operations onApplicationInfoManager,InstanceInfoandEurekaClient
-
-
Constructor Summary
Constructors Constructor Description EurekaUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetPrivateIp(InstanceInfo instanceInfo)return the privateIp address of the given InstanceInfo record.static booleanisInEc2(InstanceInfo instanceInfo)check to see if the instanceInfo record is of a server that is deployed within EC2 (best effort check based on assumptions of underlying id).static booleanisInVpc(InstanceInfo instanceInfo)check to see if the instanceInfo record is of a server that is deployed within EC2 VPC (best effort check based on assumption of existing vpcId).
-
-
-
Method Detail
-
getPrivateIp
public static java.lang.String getPrivateIp(InstanceInfo instanceInfo)
return the privateIp address of the given InstanceInfo record. The record could be for the local server or a remote server.- Parameters:
instanceInfo-- Returns:
- the private Ip (also known as localIpv4 in ec2)
-
isInEc2
public static boolean isInEc2(InstanceInfo instanceInfo)
check to see if the instanceInfo record is of a server that is deployed within EC2 (best effort check based on assumptions of underlying id). This check could be for the local server or a remote server.- Parameters:
instanceInfo-- Returns:
- true if the record contains an EC2 style "i-*" id
-
isInVpc
public static boolean isInVpc(InstanceInfo instanceInfo)
check to see if the instanceInfo record is of a server that is deployed within EC2 VPC (best effort check based on assumption of existing vpcId). This check could be for the local server or a remote server.- Parameters:
instanceInfo-- Returns:
- true if the record contains a non null, non empty AWS vpcId
-
-