|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.utils.NetworkUtils
public final class NetworkUtils
Utility class that provides method to discover the network configuration of the current machine.
| Nested Class Summary | |
|---|---|
static class |
NetworkUtils.SubnetInformation
A pair grouping an InetAddress and the corresponding subnet mask length. |
| Method Summary | |
|---|---|
static List<NetworkUtils.SubnetInformation> |
getAllNonLocalSubnetInfo()
Get a NetworkUtils.SubnetInformation object for each non local address of the currrent host. |
static String |
getHostName(String ip)
Attempt to resolve an IP address into a host name. |
static List<InetAddress> |
getIPV4Addresses()
Get a list of all known IP v4 addresses for the current host. |
static List<InetAddress> |
getIPV6Addresses()
Get a list of all known IP v6 addresses for the current host. |
static String |
getManagementHost()
Get the management host specified in the configuration file. |
static String |
getNonLocalHostAddress()
Get the non local (meaning neither localhost or loopback) address of the current host. |
static List<InetAddress> |
getNonLocalIPAddresses()
Get a list of all known non-local IP v4 and v6 addresses for the current host. |
static List<InetAddress> |
getNonLocalIPV4Addresses()
Get a list of all known non-local IP v4 addresses for the current host. |
static List<InetAddress> |
getNonLocalIPV6Addresses()
Get a list of all known non-local IP v4 addresses for the current host. |
static int |
getSubnetMaskLength(InetAddress addr)
Get the subnet mask length of a given address. |
static boolean |
isSameSubnet(NetworkUtils.SubnetInformation si1,
NetworkUtils.SubnetInformation si2)
Determine whether the 2 specified IP addresses are on the same subnet. |
static void |
main(String... args)
Main entry point. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String getNonLocalHostAddress()
public static List<InetAddress> getIPV4Addresses()
InetAddress instances, may be empty but never null.public static List<InetAddress> getNonLocalIPV4Addresses()
InetAddress instances, may be empty but never null.public static List<InetAddress> getIPV6Addresses()
Inet6Address instances, may be empty but never null.public static List<InetAddress> getNonLocalIPV6Addresses()
InetAddress instances, may be empty but never null.public static List<InetAddress> getNonLocalIPAddresses()
InetAddress instances, may be empty but never null.public static String getManagementHost()
public static String getHostName(String ip)
ip - the ip address to resolve.
public static int getSubnetMaskLength(InetAddress addr)
addr - the address for which to get the subnet mask.
public static List<NetworkUtils.SubnetInformation> getAllNonLocalSubnetInfo()
NetworkUtils.SubnetInformation object for each non local address of the currrent host.
NetworkUtils.SubnetInformation instance. This list may be empty, but never null.
public static boolean isSameSubnet(NetworkUtils.SubnetInformation si1,
NetworkUtils.SubnetInformation si2)
si1 - the first IP address to compare.si2 - the second IP address to compare.
public static void main(String... args)
args - not used.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||