directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kiran Ayyagari <ayyagariki...@gmail.com>
Subject Re: [Client API] Modify operation
Date Tue, 02 Jun 2009 01:30:14 GMT


Emmanuel Lecharny wrote:
>> hello guys,
> 
> Hi Kiran,
>>  * ModifyResponse modify( Entry entry, ModificationOperation modOp )
>>  * ModifyResponse modify( ModifyRequest modRequest )
> 
> The modify() operation acts on a DN, and takes a list of modification,
> each one of them being applied on an AttributeType.
> 
> The API should looks like :
> ModifyResponse modify( LdapDN dn, Modification[] modifications );
> 
I felt like constructing a Modification is always a kind of difficult thing, cause it is not
a one line code
(read me as lazy bum) and thought of taking out this boilerplate stuff from user's code.

* modify( Entry entry, ModificationOperation modOp )

   my idea here with this method is to apply the given 'modOp' on *all* attributes of the
given 'entry'
   which internally creates a ModifyRequest with the entry's DN and performs the operation.

   Don't know how often this is used in real world usage, but this is something I have encountered
when
   I was experimenting with the Object to LDAP Mapping code and thought this would be a good
addition.

> 
>>  * ModifyResponse modify( Entry entry, ModificationOperation modOp,
>> Control... controls )
>>  * ModifyResponse modify( ModifyRequest modRequest, Control... controls )
> 
> I don't remember if the other operations support the Control
> parameter, or if it would be better to inject those controls into the
> ModifyRequest.

yeah, I think ModifyRequest is the better place to have controls, +1
> 
>> The ModifyRequest contains the following methods
>>
>> * ModifyRequest( LdapDN dn ) - constructor
> 
> +1
> 
>> * void add( EntryAttribute attr )
>> * void add( String attributeName, String... attributeValue )
>> * void add( String attributeName, byte[]... attributeValue ) - this is a
>> overloaded version with byte[] values, same for
>>  replace and remove operations
> 
> Having such operations (add(), remove() and replace() ) is a good
> idea. I'm just wondering what could be the parameters for the
> replace() method.

here is the complete listing of replace and remove methods

* void replace( String attributeName, String... attributeValue )
* void replace( String attributeName, byte[]... attributeValue )
* void replace( EntryAttribute attr )

* void remove( String attributeName, String... attributeValue )
* void remove( String attributeName, byte[]... attributeValue )
* void remove( EntryAttribute attr )


thanks Emmanuel

Kiran Ayyagari

Mime
View raw message