|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.elasticsearch.common.network.NetworkUtils
public abstract class NetworkUtils
Nested Class Summary | |
---|---|
static class |
NetworkUtils.StackType
|
Field Summary | |
---|---|
static String |
IPv4_SETTING
|
static String |
IPv6_SETTING
|
static String |
NON_LOOPBACK_ADDRESS
|
Method Summary | |
---|---|
static boolean |
canBindToMcastAddress()
|
static Boolean |
defaultReuseAddress()
|
static Collection<InetAddress> |
getAllAvailableAddresses()
|
static List<NetworkInterface> |
getAllAvailableInterfaces()
Returns all the available interfaces, including first level sub interfaces. |
static InetAddress |
getFirstNonLoopbackAddress(NetworkInterface intf,
NetworkUtils.StackType ipVersion)
Returns the first non-loopback address on the given interface on the current host. |
static InetAddress |
getFirstNonLoopbackAddress(NetworkUtils.StackType ip_version)
Returns the first non-loopback address on any interface on the current host. |
static NetworkUtils.StackType |
getIpStackType()
Tries to determine the type of IP stack from the available interfaces and their addresses and from the system properties (java.net.preferIPv4Stack and java.net.preferIPv6Addresses) |
static InetAddress |
getIPv4Localhost()
|
static InetAddress |
getIPv6Localhost()
|
static InetAddress |
getLocalAddress()
|
static InetAddress |
getLocalhost(NetworkUtils.StackType ip_version)
|
static boolean |
interfaceHasIPAddresses(NetworkInterface intf,
NetworkUtils.StackType ipVersion)
A function to check if an interface supports an IP version (i.e has addresses defined for that IP version). |
static boolean |
isIPv4()
|
static boolean |
isStackAvailable(boolean ipv4)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String IPv4_SETTING
public static final String IPv6_SETTING
public static final String NON_LOOPBACK_ADDRESS
Method Detail |
---|
public static Boolean defaultReuseAddress()
public static boolean isIPv4()
public static InetAddress getIPv4Localhost() throws UnknownHostException
UnknownHostException
public static InetAddress getIPv6Localhost() throws UnknownHostException
UnknownHostException
public static InetAddress getLocalAddress()
public static InetAddress getLocalhost(NetworkUtils.StackType ip_version) throws UnknownHostException
UnknownHostException
public static boolean canBindToMcastAddress()
public static InetAddress getFirstNonLoopbackAddress(NetworkUtils.StackType ip_version) throws SocketException
ip_version
- Constraint on IP version of address to be returned, 4 or 6
SocketException
public static InetAddress getFirstNonLoopbackAddress(NetworkInterface intf, NetworkUtils.StackType ipVersion) throws SocketException
intf
- the interface to be checkedipVersion
- Constraint on IP version of address to be returned, 4 or 6
SocketException
public static boolean interfaceHasIPAddresses(NetworkInterface intf, NetworkUtils.StackType ipVersion) throws SocketException, UnknownHostException
intf
-
SocketException
UnknownHostException
public static NetworkUtils.StackType getIpStackType()
public static boolean isStackAvailable(boolean ipv4)
public static List<NetworkInterface> getAllAvailableInterfaces() throws SocketException
SocketException
public static Collection<InetAddress> getAllAvailableAddresses()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |