org.hyperic.util
Class HostIP
java.lang.Object
org.hyperic.util.HostIP
public class HostIP
- extends java.lang.Object
Method Summary |
static byte[] |
convertIP(java.lang.String ipAddr)
Convert a string based IP address into the byte representation. |
static byte[] |
convertIP(java.lang.String ipAddr,
int addressType)
Convert a string based IP address into the byte representation. |
static boolean |
isValidIP(java.lang.String ip)
Validate a String that represents an IP address. |
static boolean |
isValidMulticastIP(java.lang.String ip)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IP_HOST
public static final int IP_HOST
- See Also:
- Constant Field Values
IP_MULTICAST
public static final int IP_MULTICAST
- See Also:
- Constant Field Values
IP_ANY
public static final int IP_ANY
- See Also:
- Constant Field Values
HostIP
public HostIP()
convertIP
public static byte[] convertIP(java.lang.String ipAddr)
- Convert a string based IP address into the byte representation.
Same as the other convertIP method, except that ipAddr is assumed
to be a regular (i.e. host) address
convertIP
public static byte[] convertIP(java.lang.String ipAddr,
int addressType)
- Convert a string based IP address into the byte representation.
- Parameters:
ipAddr
- The address in dotted decimal notationaddressType
- Determines which addresses are considered legal.
Can be IP_HOST, IP_MULTICAST, or IP_ANY
- Returns:
- a byte array of size 4, containing the encoded address
or null indicating the ip address could not be converted
isValidIP
public static boolean isValidIP(java.lang.String ip)
- Validate a String that represents an IP address.
- Parameters:
ip
- The IP address to validate.
- Returns:
- true if the
ip
is a valid IP
address, false otherwise.
isValidMulticastIP
public static boolean isValidMulticastIP(java.lang.String ip)
- Returns:
- true if the String represents a valid multicast IP address
Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.