Examples of ModifyDnRequestImpl


Examples of org.apache.directory.api.ldap.model.message.ModifyDnRequestImpl

    public void testModifyDnAsync() throws Exception
    {
        Dn oldDn = new Dn( DN );
        Dn newDn = new Dn( "cn=modifyDnWithString,ou=system" );

        ModifyDnRequest modDnReq = new ModifyDnRequestImpl();
        modDnReq.setName( oldDn );
        modDnReq.setNewRdn( new Rdn( "cn=modifyDnWithString" ) );
        modDnReq.setDeleteOldRdn( true );

        ModifyDnFuture modifyDnFuture = connection.modifyDnAsync( modDnReq );

        ModifyDnResponse response = modifyDnFuture.get( 1000, TimeUnit.MILLISECONDS );
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.ModifyDnRequestImpl

            String msg = "Cannot process a move to a null Dn";
            LOG.debug( msg );
            throw new IllegalArgumentException( msg );
        }

        ModifyDnRequest iModDnReq = new ModifyDnRequestImpl();
        iModDnReq.setName( entryDn );
        iModDnReq.setNewSuperior( newSuperiorDn );

        ModifyDnResponse modifyDnResponse = modifyDn( iModDnReq );
        processResponse( modifyDnResponse );
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.ModifyDnRequestImpl

            String msg = "Cannot process a rename with a null Rdn";
            LOG.debug( msg );
            throw new IllegalArgumentException( msg );
        }

        ModifyDnRequest modifyDnRequest = new ModifyDnRequestImpl();
        modifyDnRequest.setName( entryDn );
        modifyDnRequest.setNewRdn( newRdn );
        modifyDnRequest.setDeleteOldRdn( deleteOldRdn );

        ModifyDnResponse modifyDnResponse = modifyDn( modifyDnRequest );
        processResponse( modifyDnResponse );

    }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.ModifyDnRequestImpl

        }

        ModifyDnResponse resp = new ModifyDnResponseImpl();
        resp.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );

        ModifyDnRequest modifyDnRequest = new ModifyDnRequestImpl();

        modifyDnRequest.setName( entryDn );
        modifyDnRequest.setNewRdn( newDn.getRdn() );
        modifyDnRequest.setNewSuperior( newDn.getParent() );
        modifyDnRequest.setDeleteOldRdn( deleteOldRdn );

        ModifyDnResponse modifyDnResponse = modifyDn( modifyDnRequest );
        processResponse( modifyDnResponse );
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.ModifyDnRequestImpl

            if( verbose )
            {
                System.out.println( "moving " + personDn + " on the server " + nc.getConfig().getLdapHost() + ":" + nc.getConfig().getLdapPort() + ":" + nc.getConfig().getLdapPort() );
            }
           
            ModifyDnRequest modReq = new ModifyDnRequestImpl();
            modReq.setName( personDn );
            modReq.setNewRdn( personDn.getRdn() );
            modReq.setNewSuperior( superiorDn );
           
            ModifyDnResponse resp = nc.modifyDn( modReq );
            ResultCodeEnum rc = resp.getLdapResult().getResultCode();
            if( rc != ResultCodeEnum.SUCCESS )
            {
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.ModifyDnRequestImpl

            connectionIndex = rand.nextInt( connections.size() );
            nc = connections.get( connectionIndex );
           
            Dn personDn = present.get( i );
           
            ModifyDnRequest modReq = new ModifyDnRequestImpl();
            Rdn newRdn = new Rdn( "cn=p_rename" + i );
            modReq.setName( personDn );
            modReq.setNewRdn( newRdn );
           
            if( verbose )
            {
                System.out.println( "renaming " + personDn + " on the server " + nc.getConfig().getLdapHost() + ":" + nc.getConfig().getLdapPort() );   
            }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.ModifyDnRequestImpl

        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 )
        {
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.ModifyDnRequestImpl

            String msg = "Cannot process a rename with a null Rdn";
            LOG.debug( msg );
            throw new IllegalArgumentException( msg );
        }

        ModifyDnRequest modDnRequest = new ModifyDnRequestImpl();
        modDnRequest.setName( entryDn );
        modDnRequest.setNewRdn( newRdn );
        modDnRequest.setDeleteOldRdn( deleteOldRdn );

        ModifyDnResponse modifyDnResponse = modifyDn( modDnRequest );

        processResponse( modifyDnResponse );
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.ModifyDnRequestImpl

            String msg = "Cannot process a move to a null Dn";
            LOG.debug( msg );
            throw new IllegalArgumentException( msg );
        }

        ModifyDnRequest modDnRequest = new ModifyDnRequestImpl();
        modDnRequest.setName( entryDn );
        modDnRequest.setNewSuperior( newSuperiorDn );

        //TODO not setting the below value is resulting in error
        modDnRequest.setNewRdn( entryDn.getRdn() );

        ModifyDnResponse modifyDnResponse = modifyDn( modDnRequest );

        processResponse( modifyDnResponse );
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.ModifyDnRequestImpl

        {
            throw new IllegalArgumentException( "The RootDSE cannot be the target" );
        }

        // Create the request
        ModifyDnRequest modDnRequest = new ModifyDnRequestImpl();
        modDnRequest.setName( entryDn );
        modDnRequest.setNewRdn( newDn.getRdn() );
        modDnRequest.setNewSuperior( newDn.getParent() );
        modDnRequest.setDeleteOldRdn( deleteOldRdn );

        ModifyDnResponse modifyDnResponse = modifyDn( modDnRequest );

        processResponse( modifyDnResponse );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.