This is what I really disliked about LdapName and Attributes. There had to be both an immutable version and a mutable version of them. For now we could use clone() heavily so any changes on the returned result set or added entry won't affect the stored entries at all.
I'm currently working LDAP Triggers as a somewhat cool addition to
ApacheDS. The progress can be partially followed from:
We allow interception of each LDAP operation with BEFORE, AFTER and
INSTEADOF triggers. There are lots of details to share but currently I
have an important question where I need some suggestions. (I'll be
sharing much more in a month.)
We allow operation specific parameters to be injected to Stored
Procedures fired by Triggers. The question is: Shall we allow
modification of these parameters by stored procedures? Shall we pass
references of real (meaning the object itself which takes place in the
operation) mutable objects and allow modification of those values? For
example, if someone performs a add operation, shall we allow the
Trigger/SP writer to modify the attributes of the entry to be added? Or
from the other perspective, shall we allow modification of search
results for instance?
Another problem is, if we allow this modification, what shall we do with
immutable types? For example, a compare operation results a boolean (I
mean the Java type) and it cannot be altered within a method it's passed.
BTW, we'll have some working Triggers/SPs in one month as we plan and
wish. Then we may further investigate what's missing and what can be
improved all together.