SearchScope scope = searchOperation.getScope();
SearchFilter filter = searchOperation.getFilter();
// Make sure the base entry exists if it's supposed to be in this backend.
Entry baseEntry = entryMap.get(baseDN);
if ((baseEntry == null) && handlesEntry(baseDN))
{
DN matchedDN = baseDN.getParentDNInSuffix();
while (matchedDN != null)
{
if (entryMap.containsKey(matchedDN))
{
break;
}
matchedDN = matchedDN.getParentDNInSuffix();
}
Message m = ERR_LDIF_BACKEND_SEARCH_NO_SUCH_BASE.get(
String.valueOf(baseDN));
throw new DirectoryException(
ResultCode.NO_SUCH_OBJECT, m, matchedDN, null);
}
if (baseEntry != null)
{
baseEntry = baseEntry.duplicate(true);
}
// If it's a base-level search, then just get that entry and return it if
// it matches the filter.
if (scope == SearchScope.BASE_OBJECT)