org.opennms.core.utils
Class InetAddressUtils

java.lang.Object
  extended by org.opennms.core.utils.InetAddressUtils

public abstract class InetAddressUtils
extends Object

Abstract InetAddressUtils class.

Version:
$Id: $
Author:
Mathew Brozowski

Constructor Summary
InetAddressUtils()
           
 
Method Summary
static InetAddress convertBigIntegerIntoInetAddress(BigInteger i)
           
static InetAddress getInetAddress(byte[] ipAddrOctets)
          getInetAddress
static InetAddress getInetAddress(long ipAddrAs32bitNumber)
          Deprecated. Dealing with IP addresses as 'long' type is not compatible with IPv6
static InetAddress getInetAddress(String dottedNotation)
          getInetAddress
static InetAddress getLowestInetAddress(List<InetAddress> addresses)
          Given a list of IP addresses, return the lowest as determined by the numeric representation and not the alphanumeric string.
static boolean isInetAddressInRange(byte[] addr, byte[] begin, byte[] end)
           
static boolean isInetAddressInRange(String addrString, String beginString, String endString)
           
static byte[] toIpAddrBytes(long address)
          Deprecated. Dealing with IP addresses as 'long' type is not compatible with IPv6
static byte[] toIpAddrBytes(String dottedNotation)
          toIpAddrBytes
static long toIpAddrLong(byte[] address)
          Deprecated. Dealing with IP addresses as 'long' type is not compatible with IPv6
static long toIpAddrLong(InetAddress addr)
          Deprecated. Dealing with IP addresses as 'long' type is not compatible with IPv6
static long toIpAddrLong(String dottedNotation)
          Deprecated. Dealing with IP addresses as 'long' type is not compatible with IPv6
static String toIpAddrString(byte[] addr)
          toIpAddrString
static String toIpAddrString(long ipAddr)
          Deprecated. Dealing with IP addresses as 'long' type is not compatible with IPv6
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InetAddressUtils

public InetAddressUtils()
Method Detail

getInetAddress

public static InetAddress getInetAddress(byte[] ipAddrOctets)

getInetAddress

Parameters:
ipAddrOctets - an array of byte.
Returns:
a InetAddress object.

getInetAddress

public static InetAddress getInetAddress(String dottedNotation)

getInetAddress

Parameters:
dottedNotation - a String object.
Returns:
a InetAddress object.

getInetAddress

public static InetAddress getInetAddress(long ipAddrAs32bitNumber)
Deprecated. Dealing with IP addresses as 'long' type is not compatible with IPv6

getInetAddress

Parameters:
ipAddrAs32bitNumber - a long.
Returns:
a InetAddress object.

toIpAddrBytes

public static byte[] toIpAddrBytes(long address)
Deprecated. Dealing with IP addresses as 'long' type is not compatible with IPv6

toIpAddrBytes

Parameters:
address - a long.
Returns:
an array of byte.

toIpAddrBytes

public static byte[] toIpAddrBytes(String dottedNotation)

toIpAddrBytes

Parameters:
dottedNotation - a String object.
Returns:
an array of byte.

toIpAddrLong

public static long toIpAddrLong(byte[] address)
Deprecated. Dealing with IP addresses as 'long' type is not compatible with IPv6

toIpAddrLong

Parameters:
address - an array of byte.
Returns:
a long.

toIpAddrLong

public static long toIpAddrLong(String dottedNotation)
Deprecated. Dealing with IP addresses as 'long' type is not compatible with IPv6

toIpAddrLong

Parameters:
dottedNotation - a String object.
Returns:
a long.

toIpAddrLong

public static long toIpAddrLong(InetAddress addr)
Deprecated. Dealing with IP addresses as 'long' type is not compatible with IPv6

toIpAddrLong

Parameters:
addr - a InetAddress object.
Returns:
a long.

toIpAddrString

public static String toIpAddrString(long ipAddr)
Deprecated. Dealing with IP addresses as 'long' type is not compatible with IPv6

toIpAddrString

Parameters:
ipAddr - a long.
Returns:
a String object.

toIpAddrString

public static String toIpAddrString(byte[] addr)

toIpAddrString

Parameters:
addr - an array of byte.
Returns:
a String object.

getLowestInetAddress

public static InetAddress getLowestInetAddress(List<InetAddress> addresses)
Given a list of IP addresses, return the lowest as determined by the numeric representation and not the alphanumeric string.

Parameters:
addresses - a List object.
Returns:
a InetAddress object.

isInetAddressInRange

public static boolean isInetAddressInRange(String addrString,
                                           String beginString,
                                           String endString)

isInetAddressInRange

public static boolean isInetAddressInRange(byte[] addr,
                                           byte[] begin,
                                           byte[] end)

convertBigIntegerIntoInetAddress

public static InetAddress convertBigIntegerIntoInetAddress(BigInteger i)
                                                    throws UnknownHostException
Throws:
UnknownHostException


Copyright © 2011. All Rights Reserved.