org.opends.server.authorization.dseecompat
Class PatternRDN

java.lang.Object
  extended by org.opends.server.authorization.dseecompat.PatternRDN

public class PatternRDN
extends java.lang.Object

This class is used to match RDN patterns containing wildcards in either the attribute types or the attribute values. Substring matching on the attribute types is not supported.


Constructor Summary
PatternRDN(java.lang.String type, java.util.ArrayList<ByteString> valuePattern, java.lang.String dnString)
          Create a new RDN pattern composed of a single attribute-value pair.
 
Method Summary
 boolean addValue(java.lang.String type, java.util.ArrayList<ByteString> valuePattern, java.lang.String dnString)
          Add another attribute-value pair to the pattern.
 int getNumValues()
          Retrieves the number of attribute-value pairs contained in this RDN pattern.
 boolean matchesRDN(RDN rdn)
          Determine whether a given RDN matches the pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternRDN

public PatternRDN(java.lang.String type,
                  java.util.ArrayList<ByteString> valuePattern,
                  java.lang.String dnString)
           throws DirectoryException
Create a new RDN pattern composed of a single attribute-value pair.

Parameters:
type - The attribute type pattern.
valuePattern - The attribute value pattern.
dnString - The DN pattern containing the attribute-value pair.
Throws:
DirectoryException - If the attribute-value pair is not valid.
Method Detail

addValue

public boolean addValue(java.lang.String type,
                        java.util.ArrayList<ByteString> valuePattern,
                        java.lang.String dnString)
                 throws DirectoryException
Add another attribute-value pair to the pattern.

Parameters:
type - The attribute type pattern.
valuePattern - The attribute value pattern.
dnString - The DN pattern containing the attribute-value pair.
Returns:
true if the type-value pair was added to this RDN, or false if it was not (e.g., it was already present).
Throws:
DirectoryException - If the attribute-value pair is not valid.

getNumValues

public int getNumValues()
Retrieves the number of attribute-value pairs contained in this RDN pattern.

Returns:
The number of attribute-value pairs contained in this RDN pattern.

matchesRDN

public boolean matchesRDN(RDN rdn)
Determine whether a given RDN matches the pattern.

Parameters:
rdn - The RDN to be matched.
Returns:
true if the RDN matches the pattern.