public abstract class InetAddressHelper
extends com.oracle.coherence.common.net.InetAddresses
Modifier and Type | Class and Description |
---|---|
static class |
InetAddressHelper.RoutableFilter
The RoutableFilter evaluates to true for any InetAddress which is
externally routable.
|
static class |
InetAddressHelper.SubnetMaskFilter
SubnetMaskFilter evaluates to true for any address with matches the
pattern for the masked bits
|
Constructor and Description |
---|
InetAddressHelper() |
Modifier and Type | Method and Description |
---|---|
static String[] |
getAddressDescriptions(Collection colAddresses)
Return an array of strings representing addresses in the specified collection.
|
static InetAddress |
getLocalAddress(Filter filter)
Obtain the "best" local host address which matches the supplied filter.
|
static Collection<InetAddress> |
getRoutableAddresses(InetAddress addrLocal,
boolean fLocalSrc,
Collection<InetAddress> colDest,
boolean fLocalDest)
Return the set of addresses from the specified destination addresses which appear to be
routable from addrLocal.
|
static boolean |
isAnyLocalAddress(InetAddress addr)
Deprecated.
As of Coherence 3.0, replaced by
InetAddress.isAnyLocalAddress() |
static boolean |
isLinkLocalAddress(InetAddress addr)
Deprecated.
As of Coherence 3.0, replaced by
InetAddress.isLinkLocalAddress() |
static boolean |
isLoopbackAddress(InetAddress addr)
Deprecated.
As of Coherence 3.0, replaced by
InetAddress.isLoopbackAddress() |
static boolean |
isSiteLocalAddress(InetAddress addr)
Deprecated.
As of Coherence 3.0, replaced by
InetAddress.isSiteLocalAddress() |
static String |
toString(byte[] ab)
Converts a byte array to a raw IP address string representation.
|
static String |
toString(InetAddress addr)
Format an IP address string representing the specified InetAddress
object.
|
static String |
toString(int nPort)
Format a port string representing the specified port number.
|
static boolean |
virtuallyEqual(byte[] abAddr1,
byte[] abAddr2)
Compare specified raw IP addresses taking into account IPv4-compatible
IPv6 addresses.
|
compare, generateMagic, getAddress, getAllLocalAddresses, getAllLocalMTUs, getByAddress, getLocalAddress, getLocalAddress, getLocalAddresses, getLocalBindableAddresses, getLocalHost, getLocalMTU, getLocalMTU, getLocalMTU, getLocalPeer, getLocalSubnetAddress, getLocalSubnetLength, getPort, getRoutes, getSocketAddress, hasNatLocalAddress, isAnyLocalAddress, isEphemeral, isHostName, isInSubnet, isLocalAddress, isLocalBindableAddress, isLocalReachableAddress, isNatLocalAddress, isNatLocalAddress, isNatLocalAddress, isNatLocalAddress, setAddress, setPort, setSubnetMask, toLong
public static InetAddress getLocalAddress(Filter filter) throws UnknownHostException
filter
- the filter to matchUnknownHostException
- if no match can be foundpublic static String[] getAddressDescriptions(Collection colAddresses)
colAddresses
- the collection of addressespublic static Collection<InetAddress> getRoutableAddresses(InetAddress addrLocal, boolean fLocalSrc, Collection<InetAddress> colDest, boolean fLocalDest)
If the addrLocal is null, or fLocalSrc is true, then all local addresses are used to compare to the set of destination addresses.
addrLocal
- the local address to compare to the destination addresses; may be nullfLocalSrc
- whether the source should be considered local to this machinecolDest
- the full collection of candidate destination addresses; may
contain non-routable local only addressesfLocalDest
- whether the destination is local to this machine@Deprecated public static boolean isLoopbackAddress(InetAddress addr)
InetAddress.isLoopbackAddress()
addr
- the InetAddress@Deprecated public static boolean isAnyLocalAddress(InetAddress addr)
InetAddress.isAnyLocalAddress()
addr
- the InetAddress@Deprecated public static boolean isLinkLocalAddress(InetAddress addr)
InetAddress.isLinkLocalAddress()
addr
- the InetAddress@Deprecated public static boolean isSiteLocalAddress(InetAddress addr)
InetAddress.isSiteLocalAddress()
addr
- the InetAddresspublic static boolean virtuallyEqual(byte[] abAddr1, byte[] abAddr2)
abAddr1
- first IP addressabAddr2
- second IP addresspublic static String toString(byte[] ab)
ab
- the byte array holding the IP addressInetAddress.getHostAddress()
,
Inet6Address
public static String toString(InetAddress addr)
addr
- the address for which to format the IP address stringInetAddress.getHostAddress()
,
Inet6Address
public static String toString(int nPort)
If nPort is an extended 32 bit port, then the output will be of the form "port.sub-port"
nPort
- the portInetSocketAddress32