directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Zoerner <ste...@labeo.de>
Subject Normalizer vs. Comparator
Date Sun, 04 Sep 2005 13:09:18 GMT
Hi all!

I have a question regarding Normalizers (first of all) and Comparators.

Here is the whole story:
I faced the problem that the compare operation does not adhere the 
matching rules. Therefore I successfully modified the CompareHandler 
class in org.apache.ldap.server.protocol to do this (whether this is the 
best place to fix this problem is not the question here).
It worked better, but not all matching rules satisfied my needs (some 
are missing). One of these is telephoneNumberMatch, and I changed 
SystemComparatorProducer to replace ComparableComparator with something, 
that implements the missing matching rule.

Two options here to implement this Comparator:
1. just implement this interface Comparator, call it 
TelephoneNumberComparator
2. Create a Normalizer for telephone numbers (removing white space and 
hyphens, transform to e.g. lower case), and instantiate a 
NormalizingComparator in SystemComparatorProducer which uses it

This leads me (finally) to the question, where normalizers are intended 
to use. I do not want my telephone number get "normalized" before 
storing it, because that would delete the formatting, which people might 
like to preserve.
Example: attribute value "0251-123-3333 0" is stored as is, but adding 
an attribute value to the entry that matches according to the matching 
rule (e.g. "025112333330") is rejected (attribute value in use).

Thanks in advance, Stefan

Btw.: If you advice me to do the right thing, I'll contribute the 
matching rule implementations which are missing. I need them to make my 
compare ops work.


Mime
View raw message