Hyperic HQ Plugin API v. 4.4.0.2

org.hyperic.util
Class HostIP

java.lang.Object
  extended by org.hyperic.util.HostIP

public class HostIP
extends java.lang.Object


Field Summary
static int IP_ANY
           
static int IP_HOST
           
static int IP_MULTICAST
           
 
Constructor Summary
HostIP()
           
 
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
 

Field Detail

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
Constructor Detail

HostIP

public HostIP()
Method Detail

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 notation
addressType - 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

Hyperic HQ Plugin API v. 4.4.0.2

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.