|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.net.InetAddressHelper
public abstract class InetAddressHelper
Helper class that encapsulates common InetAddress functionality.
Nested Class Summary | |
---|---|
static class |
InetAddressHelper.RoutableFilter The RoutableFilter evaulates to true for any InetAddress which is externally routable. |
static class |
InetAddressHelper.SubnetMaskFilter SubnetMaskFilter evaulates to true for any address with matches the pattern for the masked bits |
Field Summary | |
---|---|
static java.lang.reflect.Method |
METHOD_GET_MTU Method for obtaining the MTU from a NetworkInterface in 1.6+ JVMs. |
static boolean |
PreferIPv4Stack The value of system property "java.net.preferIPv4Stack". |
static boolean |
PreferIPv6Addresses The value of system property "java.net.preferIPv6Addresses". |
Constructor Summary | |
---|---|
InetAddressHelper() |
Method Summary | |
---|---|
static int |
compare(java.net.InetAddress addrA, java.net.InetAddress addrB) Compare two InetAddresses for ordering purposes. |
static java.util.List |
getAllLocalAddresses() Return a list of all InetAddress objects bound to all the network interfaces on this machine. |
static java.util.Map |
getAllLocalMTUs() Return a map of all InetAddress and MTUs bound to all the network interfaces on this machine. |
static java.net.InetAddress |
getByAddress(byte[] abAddr) Return an InetAddress object given the raw IP address. |
static java.net.InetAddress |
getLocalAddress(Filter filter) Obtain the "best" local host address which matches the supplied filter. |
static java.net.InetAddress |
getLocalAddress(java.lang.String sAddr) Return the local InetAddress represented by the specified string. |
static java.net.InetAddress |
getLocalHost() Obtain the local host address. |
static int |
getLocalMTU(java.net.InetAddress addr) Return the MTU for the specified local address. |
static int |
getLocalMTU(java.net.NetworkInterface ni) Return the MTU for the specified NetworkInterface. |
static java.net.InetSocketAddress |
getSocketAddress(java.lang.String sAddr, int nPort) Return the InetSocketAddress represented by the specified string. |
static boolean |
isAnyLocalAddress(java.net.InetAddress addr) Deprecated. As of Coherence 3.0, replaced by InetAddress.isAnyLocalAddress() |
static boolean |
isLinkLocalAddress(java.net.InetAddress addr) Deprecated. As of Coherence 3.0, replaced by InetAddress.isLinkLocalAddress() |
static boolean |
isLocalAddress(java.net.InetAddress addr) Return true if the specified address is a local address. |
static boolean |
isLoopbackAddress(java.net.InetAddress addr) Deprecated. As of Coherence 3.0, replaced by InetAddress.isLoopbackAddress() |
static boolean |
isSiteLocalAddress(java.net.InetAddress addr) Deprecated. As of Coherence 3.0, replaced by InetAddress.isSiteLocalAddress() |
protected static void |
setSubnetMask(byte[] ab, int cBits) Set the specified number of bits of a byte array representing a subnet mask. |
static long |
toLong(java.net.InetAddress addr) Converts an IPv4 compatible address to a long value. |
static java.lang.String |
toString(byte[] ab) Converts a byte array to a raw IP address string representation. |
static java.lang.String |
toString(java.net.InetAddress addr) Format an IP address string representing the specified InetAddress object. |
static boolean |
virtuallyEqual(byte[] abAddr1, byte[] abAddr2) Compare specified raw IP addresses taking into account IPv4-compatible IPv6 addresses. |
Field Detail |
---|
public static final boolean PreferIPv4Stack
public static final boolean PreferIPv6Addresses
public static final java.lang.reflect.Method METHOD_GET_MTU
Constructor Detail |
---|
public InetAddressHelper()
Method Detail |
---|
public static java.net.InetAddress getLocalAddress(Filter filter) throws java.net.UnknownHostException
filter
- the filter to matchjava.net.UnknownHostException
- if no match can be foundpublic static java.net.InetAddress getLocalAddress(java.lang.String sAddr) throws java.net.UnknownHostException
sAddr
- the string address, either hostname, literal ip, or subnet and maskjava.net.UnknownHostException
- if the string cannot be resolved to a local addresspublic static java.net.InetAddress getLocalHost() throws java.net.UnknownHostException
java.net.UnknownHostException
public static int compare(java.net.InetAddress addrA, java.net.InetAddress addrB)
addrA
- the first address to compareaddrB
- the second address to comparepublic static int getLocalMTU(java.net.InetAddress addr)
addr
- the local addresspublic static int getLocalMTU(java.net.NetworkInterface ni)
ni
- the network interfacepublic static java.util.List getAllLocalAddresses()
public static java.util.Map getAllLocalMTUs()
public static java.net.InetSocketAddress getSocketAddress(java.lang.String sAddr, int nPort) throws java.net.UnknownHostException
sAddr
- a legal address stringnPort
- a default port to use if sAddr does not contain onejava.net.UnknownHostException
public static boolean isLocalAddress(java.net.InetAddress addr)
addr
- the address to check
@Deprecated
public static boolean isLoopbackAddress(java.net.InetAddress addr)
InetAddress.isLoopbackAddress()
addr
- the InetAddress
@Deprecated
public static boolean isAnyLocalAddress(java.net.InetAddress addr)
InetAddress.isAnyLocalAddress()
addr
- the InetAddress
@Deprecated
public static boolean isLinkLocalAddress(java.net.InetAddress addr)
InetAddress.isLinkLocalAddress()
addr
- the InetAddress
@Deprecated
public static boolean isSiteLocalAddress(java.net.InetAddress addr)
InetAddress.isSiteLocalAddress()
addr
- the InetAddresspublic static java.net.InetAddress getByAddress(byte[] abAddr) throws java.net.UnknownHostException
abAddr
- the raw IP address in network byte orderjava.net.UnknownHostException
public static boolean virtuallyEqual(byte[] abAddr1, byte[] abAddr2)
abAddr1
- first IP addressabAddr2
- second IP addresspublic static long toLong(java.net.InetAddress addr)
addr
- an instance of InetAddress to convert to a longpublic static java.lang.String toString(byte[] ab)
ab
- the byte array holding the IP addressInetAddress.getHostAddress()
, Inet6Address
public static java.lang.String toString(java.net.InetAddress addr)
addr
- the address for which to format the IP address stringInetAddress.getHostAddress()
, Inet6Address
protected static void setSubnetMask(byte[] ab, int cBits)
ab
- the array to fillcBits
- the number of bits to set
|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |