}
public void moveOutOfReplAreaAndCompare() throws Exception
{
Dn parentDn = new Dn( "ou=parent,ou=children,ou=grandchildren");
Dn currentDn = new Dn( REPL_AREA_SUFFIX );
LdapNetworkConnection nc = connections.get( 0 );
for( Rdn rdn : parentDn.getRdns() )
{
currentDn = new Dn( rdn.getName() + "," + currentDn.getName() );
Entry e = new DefaultEntry( currentDn.getName(),
"objectclass: top",
"objectclass: organizationalUnit",
"ou: " + rdn.getAva().getValue().getString() );
nc.add( e );
}
compareEntries( Collections.singletonList( currentDn ) );
Dn ouDn = currentDn.getParent().getParent();
if( verbose )
{
System.out.println( "moving " + ouDn + " on the server " + nc.getConfig().getLdapHost() + ":" + nc.getConfig().getLdapPort() + ":" + nc.getConfig().getLdapPort() );
}
ModifyDnRequest modReq = new ModifyDnRequestImpl();
modReq.setName( ouDn );
modReq.setNewRdn( ouDn.getRdn() );
modReq.setNewSuperior( ouDn.getParent().getParent() );
ModifyDnResponse resp = nc.modifyDn( modReq );
ResultCodeEnum rc = resp.getLdapResult().getResultCode();
if( rc != ResultCodeEnum.SUCCESS )
{