org.opends.server.types
Class AddressMask

java.lang.Object
  extended by org.opends.server.types.AddressMask

@PublicAPI(stability=VOLATILE,
           mayInstantiate=true,
           mayExtend=false,
           mayInvoke=true)
public final class AddressMask
extends java.lang.Object

This class defines an address mask, which can be used to perform efficient comparisons against IP addresses to determine whether a particular IP address is in a given range.


Method Summary
static AddressMask decode(java.lang.String maskString)
          Decodes the provided string as an address mask.
static boolean maskListContains(byte[] remoteAddr, java.lang.String remoteName, AddressMask[] masks)
          Indicates whether provided address or hostname matches one of the address masks in the provided array.
 java.lang.String toString()
          Retrieves a string representation of this address mask.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

decode

public static AddressMask decode(java.lang.String maskString)
                          throws ConfigException
Decodes the provided string as an address mask.

Parameters:
maskString - The string to decode as an address mask.
Returns:
AddressMask The address mask decoded from the provided string.
Throws:
ConfigException - If the provided string cannot be decoded as an address mask.

maskListContains

public static boolean maskListContains(byte[] remoteAddr,
                                       java.lang.String remoteName,
                                       AddressMask[] masks)
Indicates whether provided address or hostname matches one of the address masks in the provided array.

Parameters:
remoteAddr - The remote address byte array.
remoteName - The remote host name string.
masks - An array of address masks to check.
Returns:
true if the provided address or hostname does match one of the given address masks, or false if it does not.

toString

public java.lang.String toString()
Retrieves a string representation of this address mask.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this address mask.