Examples of ModifyDNRequest


Examples of org.apache.directory.ldap.client.api.message.ModifyDnRequest

     * @return modifyDn operations response
     * @throws LdapException
     */
    public ModifyDnResponse move( DN entryDn, DN newSuperiorDn ) throws LdapException
    {
        ModifyDnRequest modDnRequest = new ModifyDnRequest();
        modDnRequest.setEntryDn( entryDn );
        modDnRequest.setNewSuperior( newSuperiorDn );

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

        return modifyDn( modDnRequest );
    }
View Full Code Here

Examples of org.apache.directory.ldap.client.api.message.ModifyDnRequest

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

        ModifyDnRequest modDnReq = new ModifyDnRequest();
        modDnReq.setEntryDn( oldDn );
        modDnReq.setNewRdn( new RDN( "cn=modifyDnWithString" ) );
        modDnReq.setDeleteOldRdn( true );

        ModifyDnFuture modifyDnFuture = connection.modifyDnAsync( modDnReq );
       
        try
        {
View Full Code Here

Examples of org.apache.directory.shared.ldap.codec.modifyDn.ModifyDNRequest

     */
    public Element toDsml( Element root )
    {
        Element element = super.toDsml( root );
       
        ModifyDNRequest request = ( ModifyDNRequest ) instance;
       
        // DN
        if ( request.getEntry() != null )
        {
            element.addAttribute( "dn", request.getEntry().toString() );
        }
       
        // NewRDN
        if ( request.getNewRDN() != null )
        {
            element.addAttribute( "newrdn", request.getNewRDN().toString() );
        }
       
        // DeleteOldRDN
        element.addAttribute( "deleteoldrdn", ( request.isDeleteOldRDN() ? "true" : "false" ) );
       
        // NewSuperior
        if ( request.getNewRDN() != null )
        {
            element.addAttribute( "newSuperior", request.getNewSuperior().toString() );
        }
       
        return element;
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.message.ModifyDnRequest

            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.shared.ldap.model.message.ModifyDnRequest

            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.shared.ldap.model.message.ModifyDnRequest

        {
            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

Examples of org.apache.directory.shared.ldap.model.message.ModifyDnRequest

    /**
     * {@inheritDoc}
     */
    public void action( LdapMessageContainer<ModifyDnRequestDecorator> container ) throws DecoderException
    {
        ModifyDnRequest modifyDnRequest = container.getMessage();

        TLV tlv = container.getCurrentTLV();

        // We get the value. If it's a 0, it's a FALSE. If it's
        // a FF, it's a TRUE. Any other value should be an error,
        // but we could relax this constraint. So if we have
        // something
        // which is not 0, it will be interpreted as TRUE, but we
        // will generate a warning.
        Value value = tlv.getValue();

        try
        {
            modifyDnRequest.setDeleteOldRdn( BooleanDecoder.parse( value ) );
        }
        catch ( BooleanDecoderException bde )
        {
            LOG.error( I18n
                .err( I18n.ERR_04091, Strings.dumpBytes( value.getData() ), bde.getMessage() ) );

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( bde.getMessage() );
        }

        // We can have an END transition
        container.setGrammarEndAllowed( true );

        if ( IS_DEBUG )
        {
            if ( modifyDnRequest.getDeleteOldRdn() )
            {
                LOG.debug( " Old Rdn attributes will be deleted" );
            }
            else
            {
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.message.ModifyDnRequest

        catch ( Exception e )
        {
            fail( e.getMessage() );
        }

        ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();

        assertEquals( 456, modifyDNRequest.getMessageId() );
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.message.ModifyDnRequest

        catch ( Exception e )
        {
            fail( e.getMessage() );
        }

        ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();
        Map<String, Control> controls = modifyDNRequest.getControls();

        assertEquals( 1, modifyDNRequest.getControls().size() );

        Control control = controls.get( "1.2.840.113556.1.4.643" );

        assertNotNull( control );
        assertTrue( control.isCritical() );
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.message.ModifyDnRequest

        catch ( Exception e )
        {
            fail( e.getMessage() );
        }

        ModifyDnRequest modifyDNRequest = ( ModifyDnRequest ) parser.getBatchRequest().getCurrentRequest();
        Map<String, Control> controls = modifyDNRequest.getControls();

        assertEquals( 1, modifyDNRequest.getControls().size() );

        Control control = controls.get( "1.2.840.113556.1.4.643" );

        assertNotNull( control );
        assertTrue( control.isCritical() );
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.