LdapConnection conn = getWiredConnection( getLdapServer() );
ManageDsaIT manageDSAIT = new ManageDsaITImpl();
manageDSAIT.setCritical( true );
ModifyDnRequest modifyDnRequest = new ModifyDnRequestImpl();
modifyDnRequest.setName( new Dn( "uid=elecharny,ou=users,ou=system" ) );
modifyDnRequest.setNewRdn( new Rdn( "uid=newuser" ) );
modifyDnRequest.setNewSuperior( new Dn( "uid=akarasuluref,ou=users,ou=system" ) );
modifyDnRequest.setDeleteOldRdn( true );
modifyDnRequest.addControl( manageDSAIT );
// ModifyDN success
try
{
conn.modifyDn( modifyDnRequest );