Package org.apache.directory.shared.ldap.model.message

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


        for ( Modification modification : mods )
        {
            modReq.addModification( modification );
        }

        ModifyResponse resp = userConnection.modify( modReq );

        if ( resp.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
        {
            result = true;
        }
        else
        {
View Full Code Here


        LdapConnection userConnection = getConnectionAs( userName, password );
        ModifyRequest modReq = new ModifyRequestImpl();
        modReq.setName( entryDn );
        modReq.addModification( attr, modOp );

        ModifyResponse resp = userConnection.modify( modReq );

        if ( resp.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
        {
            result = true;
        }
        else
        {
View Full Code Here

        for ( Modification modification : mods )
        {
            modReq.addModification( modification );
        }

        ModifyResponse resp = connection.modify( modReq );

        return resp.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS;
    }
View Full Code Here

            de.printStackTrace();
            fail( de.getMessage() );
        }

        // Check the decoded ModifyResponse PDU
        ModifyResponse modifyResponse = ldapMessageContainer.getMessage();

        assertEquals( 1, modifyResponse.getMessageId() );
        assertEquals( ResultCodeEnum.SUCCESS, modifyResponse.getLdapResult().getResultCode() );
        assertEquals( "", modifyResponse.getLdapResult().getMatchedDn().getName() );
        assertEquals( "", modifyResponse.getLdapResult().getDiagnosticMessage() );

        // Check the encoding
        try
        {
            ByteBuffer bb = encoder.encodeMessage( modifyResponse );
View Full Code Here

            de.printStackTrace();
            fail( de.getMessage() );
        }

        // Check the decoded ModifyResponse PDU
        ModifyResponse modifyResponse = ldapMessageContainer.getMessage();

        assertEquals( 1, modifyResponse.getMessageId() );
        assertEquals( ResultCodeEnum.SUCCESS, modifyResponse.getLdapResult().getResultCode() );
        assertEquals( "", modifyResponse.getLdapResult().getMatchedDn().getName() );
        assertEquals( "", modifyResponse.getLdapResult().getDiagnosticMessage() );

        // Check the Control
        Map<String, Control> controls = modifyResponse.getControls();

        assertEquals( 1, controls.size() );

        @SuppressWarnings("unchecked")
        CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> )controls.get( "2.16.840.1.113730.3.4.2" );
View Full Code Here

                break;

            case MODIFY_RESPONSE:
                // Transform the response
                ModifyResponse modifyResponse = ( ModifyResponse ) response;

                ModifyFuture modifyFuture = ( ModifyFuture ) responseFuture;

                if ( LOG.isDebugEnabled() )
                {
                    if ( modifyResponse.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
                    {
                        // Everything is fine, return the response
                        LOG.debug( "ModifyFuture successful : {}", modifyResponse );
                    }
                    else
View Full Code Here

        while ( itr.hasNext() )
        {
            modReq.addModification( itr.next(), modOp );
        }

        ModifyResponse modifyResponse = modify( modReq );

        processResponse( modifyResponse );
    }
View Full Code Here

        for ( Modification modification : modifications )
        {
            modReq.addModification( modification );
        }

        ModifyResponse modifyResponse = modify( modReq );

        processResponse( modifyResponse );
    }
View Full Code Here

        // Get the result from the future
        try
        {
            // Read the response, waiting for it if not available immediately
            // Get the response, blocking
            ModifyResponse modifyResponse = modifyFuture.get( timeout, TimeUnit.MILLISECONDS );

            if ( modifyResponse == null )
            {
                // We didn't received anything : this is an error
                LOG.error( "Modify failed : timeout occured" );
                throw new LdapException( TIME_OUT_ERROR );
            }

            if ( modifyResponse.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
            {
                // Everything is fine, return the response
                LOG.debug( "Modify successful : {}", modifyResponse );
            }
            else
            {
                if ( modifyResponse instanceof ModifyNoDResponse )
                {
                    // A NoticeOfDisconnect : deserves a special treatment
                    throw new LdapException( modifyResponse.getLdapResult().getDiagnosticMessage() );
                }

                // We have had an error
                LOG.debug( "Modify failed : {}", modifyResponse );
            }
View Full Code Here

                break;

            case MODIFY_RESPONSE:
                // Transform the response
                ModifyResponse modifyResponse = ( ModifyResponse ) response;

                ModifyFuture modifyFuture = ( ModifyFuture ) responseFuture;

                if ( LOG.isDebugEnabled() )
                {
                    if ( modifyResponse.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
                    {
                        // Everything is fine, return the response
                        LOG.debug( "ModifyFuture successful : {}", modifyResponse );
                    }
                    else
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.message.ModifyResponse

Copyright © 2018 www.massapicom. 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.