directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Seelmann <seelm...@apache.org>
Subject Re: Filtering entries on a custom partition
Date Sat, 30 Apr 2011 11:39:58 GMT
On Fri, Apr 29, 2011 at 4:07 PM, Javier Mendez Vasquez
<jmendez@searchtechnologies.com> wrote:
> Hi, thanks for your reply.
>
> Yes, I implemented a custom partition (the interface org.apache.directory.server.core.partition.Partition).
>
> I'm using version is 1.5.5 of Apache DS.
>
> What do you mean by Backend? Is this how I implement the data store?

Yes.

> Based on your comments, I need to add more 'ifs' to filter the results? For example:
>
>        if (!ctx.getFilter().toString().contains("objectClass=person"))
>
> Then return only the entries I'm interested in?

In principle yes.

But to evaluate if an entry matches an LDAP filter is much more
complex. Filters can be deeply nested combinations of 'and', 'or', and
'not' choices. Beside equality filters there also substring, presence,
lessThanOrQual, etc. matches. The matching rule for a particular
attribute must also be considered (e.g. caseIgnoreMatch or
caseExactMatch). So it's quite hard to implement that with 'ifs'.

So as Kiran mentioned, take a look into the DefaultSearchEngine and
all the Evaluators:
http://svn.apache.org/repos/asf/directory/apacheds/tags/1.5.5/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/

Kind Regards,
Stefan

Mime
View raw message