Package org.forgerock.opendj.ldap
Class AddressMask
java.lang.Object
org.forgerock.opendj.ldap.AddressMask
An address mask can be used to perform efficient comparisons against IP
addresses to determine whether a particular IP address is in a given range.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isAllowed
(Collection<AddressMask> masks, InetAddress address) Returnstrue
if an address is in the provided allow list.static boolean
isDenied
(Collection<AddressMask> masks, InetAddress address) Returnstrue
if an address is in the provided deny list.static boolean
isIn
(Collection<AddressMask> masks, InetAddress address) Returnstrue
if an address matches any of the provided address masks.boolean
matches
(InetAddress address) Returnstrue
if this address mask matches the provided address.toString()
static AddressMask
Parses the provided string as an address mask.
-
Method Details
-
isIn
Returnstrue
if an address matches any of the provided address masks.- Parameters:
masks
- A collection of address masks to check.address
- The address.- Returns:
true
if an address matches any of the provided address masks
-
isAllowed
Returnstrue
if an address is in the provided allow list. The address is tested only when a non-empty collection of address masks is provided.- Parameters:
masks
- A collection of address masks to check.address
- The address.- Returns:
true
if an address is in the provided allow list
-
isDenied
Returnstrue
if an address is in the provided deny list.- Parameters:
masks
- A collection of address masks to check.address
- The address.- Returns:
true
if an address is in the provided deny list
-
valueOf
Parses the provided string as an address mask.- Parameters:
mask
- The address mask string to be parsed.- Returns:
- The parsed address mask.
- Throws:
LocalizedIllegalArgumentException
- If the provided string cannot be decoded as an address mask.
-
matches
Returnstrue
if this address mask matches the provided address.- Parameters:
address
- The address- Returns:
true
if this address mask matches the provided address
-
toString
-