org.apache.camel.util
Class HostUtils

java.lang.Object
  extended by org.apache.camel.util.HostUtils

public final class HostUtils
extends Object


Method Summary
static Set<InetAddress> getAddresses()
          Returns a Set of InetAddress that are non-loopback or mac.
static String getLocalHostName()
          Returns the local hostname.
static String getLocalIp()
          Returns the local IP.
static Map<String,Set<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
 

Method Detail

getNetworkInterfaceAddresses

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


getAddresses

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


getLocalHostName

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

Throws:
UnknownHostException

getLocalIp

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

Throws:
UnknownHostException


Apache Camel