mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

coulbeck
27.05.2007 6932146c7ce6be2b604fd68d4ae6450ce784a80f
opends/src/server/org/opends/server/authorization/dseecompat/PatternDN.java
@@ -103,6 +103,32 @@
  }
  /**
   * Create a new DN pattern matcher to match a suffix.
   * @param pattern The suffix pattern string.
   * @throws org.opends.server.types.DirectoryException If the pattern string
   * is not valid.
   * @return A new DN pattern matcher.
   */
  public static PatternDN decodeSuffix(String pattern) throws DirectoryException
  {
    AttributeType fakeType =
         DirectoryServer.getAttributeType(PATTERN_DN_FAKE_TYPE_NAME);
    if (fakeType == null)
    {
       fakeType =
            DirectoryServer.getDefaultAttributeType(PATTERN_DN_FAKE_TYPE_NAME);
    }
    SearchFilter filter;
    DN patternDN = DN.decode(pattern);
    String filterStr = PATTERN_DN_FAKE_TYPE_NAME + "=*" +
         patternDN.toNormalizedString();
    filter=SearchFilter.createFilterFromString(filterStr);
    return new PatternDN(fakeType, filter);
  }
  /**
   * Determine whether a given DN matches this pattern.
   * @param dn The DN to be matched.
   * @return true if the DN matches the pattern.