com.openexchange.admin.tools
Class NetUtil

java.lang.Object
  extended by com.openexchange.admin.tools.NetUtil

public class NetUtil
extends Object

Author:
choeger

Constructor Summary
NetUtil()
           
 
Method Summary
static void checkValidIPNetmask(String ipmask)
          check if ipmask is a valid network definition either in cidr or dotted decimal notation.
static String CIDR2Mask(int cidr)
          return dotted decimal notation representation as a String of the CIDR representation of the netmask
static boolean isValidBroadcast(String broadcast, String net, String mask)
          check if broadcast address matches with given network and netmask network could also be an ip address fitting in the network
static boolean isValidIPAddress(String address)
          check if address is a valid ip address in dotted decimal notation.
static boolean isValidIPNetmask(String ipmask)
          check if ipmask is a valid network definition either in cidr or dotted decimal notation.
static boolean isValidNetmask(String mask)
          check if mask is a valid netmask in dotted decimal notation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetUtil

public NetUtil()
Method Detail

isValidBroadcast

public static final boolean isValidBroadcast(String broadcast,
                                             String net,
                                             String mask)
check if broadcast address matches with given network and netmask network could also be an ip address fitting in the network

Parameters:
broadcast -
net -
mask -
Returns:

isValidNetmask

public static final boolean isValidNetmask(String mask)
check if mask is a valid netmask in dotted decimal notation.

Parameters:
mask -
Returns:

isValidIPAddress

public static final boolean isValidIPAddress(String address)
check if address is a valid ip address in dotted decimal notation.

Parameters:
address -
Returns:

isValidIPNetmask

public static final boolean isValidIPNetmask(String ipmask)
check if ipmask is a valid network definition either in cidr or dotted decimal notation.

Parameters:
ipmask -
Returns:

checkValidIPNetmask

public static final void checkValidIPNetmask(String ipmask)
                                      throws InvalidDataException
check if ipmask is a valid network definition either in cidr or dotted decimal notation.

Parameters:
ipmask -
Throws:
InvalidDataException

CIDR2Mask

public static final String CIDR2Mask(int cidr)
return dotted decimal notation representation as a String of the CIDR representation of the netmask

Parameters:
cidr -
Returns: