public class BrooklynNetworkUtils
extends java.lang.Object
Networking
for more generic network utilities.Constructor and Description |
---|
BrooklynNetworkUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getLocalhostExternalIp()
returns the externally-facing IP address from which this host comes, or 127.0.0.1 if not resolvable
|
static java.net.InetAddress |
getLocalhostInetAddress()
returns an IP address for localhost,
paying attention to system property
BrooklynServiceAttributes.LOCALHOST_IP_ADDRESS
if set to prevent default selection when needed,
otherwise finding the first bindable/reachable NIC from a system lookup which usually
prefers IPv4 then non-loopback devices (but use the system property if if needed) |
public static java.lang.String getLocalhostExternalIp()
public static java.net.InetAddress getLocalhostInetAddress()
BrooklynServiceAttributes.LOCALHOST_IP_ADDRESS
if set to prevent default selection when needed,
otherwise finding the first bindable/reachable NIC from a system lookup which usually
prefers IPv4 then non-loopback devices (but use the system property if if needed)