Class PatternRDN


  • public class PatternRDN
    extends 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 Detail

      • PatternRDN

        public PatternRDN​(String type,
                          List<ByteString> valuePattern,
                          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​(String type,
                                List<ByteString> valuePattern,
                                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.