org.fusesource.fabric.utils
Class HostUtils

java.lang.Object
  extended by org.fusesource.fabric.utils.HostUtils

public class HostUtils
extends java.lang.Object


Field Summary
static java.lang.String PREFERED_ADDRESS_PROPERTY_NAME
           
 
Method Summary
static java.util.Set<java.net.InetAddress> getAddresses()
          Returns a Set of InetAddress that are non-loopback or mac.
static java.lang.String getLocalHostName()
          Returns the local hostname.
static java.lang.String getLocalIp()
          Returns the local IP.
static java.util.Map<java.lang.String,java.util.Set<java.net.InetAddress>> getNetworkInterfaceAddresses()
          Returns a of InetAddress per NetworkInterface as a Map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFERED_ADDRESS_PROPERTY_NAME

public static final java.lang.String PREFERED_ADDRESS_PROPERTY_NAME
See Also:
Constant Field Values
Method Detail

getNetworkInterfaceAddresses

public static java.util.Map<java.lang.String,java.util.Set<java.net.InetAddress>> getNetworkInterfaceAddresses()
Returns a of InetAddress per NetworkInterface as a Map.

Returns:

getAddresses

public static java.util.Set<java.net.InetAddress> getAddresses()
Returns a Set of InetAddress that are non-loopback or mac.

Returns:

getLocalHostName

public static java.lang.String getLocalHostName()
                                         throws java.net.UnknownHostException
Returns the local hostname. It loops through the network interfaces and returns the first non loopback address

Returns:
Throws:
java.net.UnknownHostException

getLocalIp

public static java.lang.String getLocalIp()
                                   throws java.net.UnknownHostException
Returns the local IP. It loops through the network interfaces and returns the first non loopback address

Returns:
Throws:
java.net.UnknownHostException


Copyright © 2012 FuseSource. All Rights Reserved.