You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Kiran Ayyagari <ay...@gmail.com> on 2009/06/07 09:56:38 UTC

[Client API] ModifyDN and Delete operations

Hi,

    Here is the proposed API for

ModifyDN operation:

     * modifyDn( String entryDn, String newRdn, boolean deleteOldRdn )
     * modifyDn( String entryDn, String newRdn, String newParentDn, boolean deleteOldRdn )
     * modifyDn( LdapDN entryDn, Rdn newRDN, boolean deleteOldRDN )
     * modifyDn( LdapDN entry, Rdn newRDN, LdapDN newParentDn, boolean deleteOldRDN )
     * modifyDn( ModifyDNRequest modDnRequest, ModifyDnListener listener )

Delete operation:

     * delete( String dn )
     * delete( LdapDN dn )
     * delete( DeleteRequest delRequest, DeleteListener listener )

requesting your comments

Kiran Ayyagari

Re: [Client API] ModifyDN and Delete operations

Posted by Kiran Ayyagari <ay...@gmail.com>.
Stefan Seelmann wrote:
>>>
>>> What about another method to allow deletion of children ?
>>>
>>> deleteChildren( String/LdapDN dn) ?
> 
> What would be the exact meaning of this method?
> - only the immediate children
> - recursively all children
> - the DN plus recursively all children
this method is a bit ambiguous when seen through the above three points
I treated this method as mentioned in point 2 - recursively all children.

May be we can have a method like

  * delete( String/LdapDN dn, boolean deleteChildren )

   the dn and *all* its children will be removed if deleteChildren set to true
   else the dn alone will be deleted

> 
> But what would be tricky is the implementation:
> - Use tree delete control
this is the preferred way IMO
> - try to delete parent first, if error delete children first
> - check for children first
in the absence of tree delete control, I would prefer 'check for children first'
(to save an additional hit on the same dn to fetch children, if exist)
> - what about following aliases and referrals, could be
honestly no clue atm

thanks Seelmann

Kiran Ayyagari

Re: [Client API] ModifyDN and Delete operations

Posted by Stefan Seelmann <se...@apache.org>.
Hi,

> 
> 
> Emmanuel Lecharny wrote:
>>>    * modifyDn( String entryDn, String newRdn, boolean deleteOldRdn )
>>>    * modifyDn( String entryDn, String newRdn, String newParentDn,
>>> boolean
>>> deleteOldRdn )
>>>    * modifyDn( LdapDN entryDn, Rdn newRDN, boolean deleteOldRDN )
>>>    * modifyDn( LdapDN entry, Rdn newRDN, LdapDN newParentDn, boolean
>>> deleteOldRDN )
>>>    * modifyDn( ModifyDNRequest modDnRequest, ModifyDnListener listener )
>>
>> Sounds good. I'm wondering if offering methods like :
>> rename( LdapDN oldDN, RDN newRdn)
>> move( LdapDN oldDN, LdapDN newDn)
>>
>> would be better or not ?
> same here, and finally thought of going with the 'modifyDn' name as per
> RFC but
> really prefer the move and rename methods.
> what do you say again, should we go for these names? from my side +1.
> Want to hear from others too, who might have used different client
> libraries.

+1

> 
>>
>> Also, I think it's probably better to have the same method without the
>> deleteOldRdn flag (it's not really frequently used, and it can default
>> to true).

Yes, a overload without this flag would be good.

>>
>> Last, not least, accepting String could be cool, but we can extend the
>> API later.
> yeah, the list of overloaded methods for this operation is higher than
> any other
> operation.
>>> Delete operation:
>>>
>>>    * delete( String dn )
>>>    * delete( LdapDN dn )
>>>    * delete( DeleteRequest delRequest, DeleteListener listener )
>>
>> Loks fine to me.
>>
>> What about another method to allow deletion of children ?
>>
>> deleteChildren( String/LdapDN dn) ?

What would be the exact meaning of this method?
- only the immediate children
- recursively all children
- the DN plus recursively all children

But what would be tricky is the implementation:
- Use tree delete control
- try to delete parent first, if error delete children first
- check for children first
- what about following aliases and referrals, could be


Kind Regards,
Stefan


Re: [Client API] ModifyDN and Delete operations

Posted by Kiran Ayyagari <ay...@gmail.com>.

Emmanuel Lecharny wrote:
>>    * modifyDn( String entryDn, String newRdn, boolean deleteOldRdn )
>>    * modifyDn( String entryDn, String newRdn, String newParentDn, boolean
>> deleteOldRdn )
>>    * modifyDn( LdapDN entryDn, Rdn newRDN, boolean deleteOldRDN )
>>    * modifyDn( LdapDN entry, Rdn newRDN, LdapDN newParentDn, boolean
>> deleteOldRDN )
>>    * modifyDn( ModifyDNRequest modDnRequest, ModifyDnListener listener )
> 
> Sounds good. I'm wondering if offering methods like :
> rename( LdapDN oldDN, RDN newRdn)
> move( LdapDN oldDN, LdapDN newDn)
> 
> would be better or not ?
same here, and finally thought of going with the 'modifyDn' name as per RFC but
really prefer the move and rename methods.
what do you say again, should we go for these names? from my side +1.
Want to hear from others too, who might have used different client libraries.

> 
> Also, I think it's probably better to have the same method without the
> deleteOldRdn flag (it's not really frequently used, and it can default
> to true).
> 
> Last, not least, accepting String could be cool, but we can extend the
> API later.
yeah, the list of overloaded methods for this operation is higher than any other
operation.
>> Delete operation:
>>
>>    * delete( String dn )
>>    * delete( LdapDN dn )
>>    * delete( DeleteRequest delRequest, DeleteListener listener )
> 
> Loks fine to me.
> 
> What about another method to allow deletion of children ?
> 
> deleteChildren( String/LdapDN dn) ?

+1

thanks Emmanuel

Kiran Ayyagari

Re: [Client API] ModifyDN and Delete operations

Posted by Emmanuel Lecharny <el...@apache.org>.
On Sun, Jun 7, 2009 at 9:56 AM, Kiran Ayyagari<ay...@gmail.com> wrote:
> Hi,
>
>   Here is the proposed API for
>
> ModifyDN operation:
>
>    * modifyDn( String entryDn, String newRdn, boolean deleteOldRdn )
>    * modifyDn( String entryDn, String newRdn, String newParentDn, boolean
> deleteOldRdn )
>    * modifyDn( LdapDN entryDn, Rdn newRDN, boolean deleteOldRDN )
>    * modifyDn( LdapDN entry, Rdn newRDN, LdapDN newParentDn, boolean
> deleteOldRDN )
>    * modifyDn( ModifyDNRequest modDnRequest, ModifyDnListener listener )

Sounds good. I'm wondering if offering methods like :
rename( LdapDN oldDN, RDN newRdn)
move( LdapDN oldDN, LdapDN newDn)

would be better or not ?

Also, I think it's probably better to have the same method without the
deleteOldRdn flag (it's not really frequently used, and it can default
to true).

Last, not least, accepting String could be cool, but we can extend the
API later.

>
> Delete operation:
>
>    * delete( String dn )
>    * delete( LdapDN dn )
>    * delete( DeleteRequest delRequest, DeleteListener listener )

Loks fine to me.

What about another method to allow deletion of children ?

deleteChildren( String/LdapDN dn) ?


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com