You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Krzysztof Szymko <kr...@faven.pl> on 2017/12/06 00:46:48 UTC
Users guide feedback
Hi,
I've been reading the guide (http://directory.apache.org/api/user-guide.html) and I've found the following errors:
1) 2.5 - Deleting entries
Simple entry deletion (listing for testDeleteLeafNode())
DeleteResponse response = connection.delete( "cn=child1,cn=parent,ou=system" );
method's signature is: delete(String) - void, so shouldn't it be:
DeleteRequest deleteRequest = new DeleteRequestImpl(); deleteRequest.setName(new Dn( "cn=child1,cn=parent,ou=system"));
DeleteResponse response = connection.delete(deleteRequest);
2) 2.6 - Modyfing entries
Removing an attribute
typo: attrinute
I was using version 1.0.0 of the jar for testing.
Best regards,
Krzysztof Szymko
Re: Users guide feedback
Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 06/12/2017 à 01:46, Krzysztof Szymko a écrit :
> Hi,
>
> I've been reading the guide (http://directory.apache.org/api/user-guide.html) and I've found the following errors:
>
> 1) 2.5 - Deleting entries
> Simple entry deletion (listing for testDeleteLeafNode())
> DeleteResponse response = connection.delete( "cn=child1,cn=parent,ou=system" );
> method's signature is: delete(String) - void, so shouldn't it be:
> DeleteRequest deleteRequest = new DeleteRequestImpl(); deleteRequest.setName(new Dn( "cn=child1,cn=parent,ou=system"));
> DeleteResponse response = connection.delete(deleteRequest);
Correct. The method throws an exception in this case, so one should use
a try...catch around the delete call, or use the code you suggest.
Note that the LdapConnection API defines 3 methods for the delete
operation :
* void delete( Dn dn ) throws LdapException
* void delete( String dn ) throws LdapException
* DeleteResponse delete( DeleteRequest deleteRequest ) throws LdapException
The last method is to be used when you want to add a control to the request.
Fixed.
>
> 2) 2.6 - Modyfing entries
> Removing an attribute
> typo: attrinute
Fixed.
Many thanks for the feedback, it's really appreciated and helps
improving the rproject !
--
Emmanuel Lecharny
Symas.com
directory.apache.org