Package org.apache.directory.shared.dsmlv2.reponse

Examples of org.apache.directory.shared.dsmlv2.reponse.CompareResponseDsml


                break;

            case COMPARE_REQUEST:
                CompareResponse compareResponse = connection.compare( ( CompareRequest ) request );
                resultCode = compareResponse.getLdapResult().getResultCode();
                CompareResponseDsml compareResponseDsml = new CompareResponseDsml( connection.getCodecService(),
                    compareResponse );
                writeResponse( respWriter, compareResponseDsml );

                break;
View Full Code Here


        // we need a more advanced connection wrapper.

        // Creating the response
        if ( batchResponseDsml != null )
        {
            CompareResponseDsml compareResponseDsml = new CompareResponseDsml( codec );
            LdapResult ldapResult = compareResponseDsml.getLdapResult();
            ldapResult.setResultCode( ResultCodeEnum.UNWILLING_TO_PERFORM );
            ldapResult.setDiagnosticMessage( BrowserCoreMessages.dsml__kind_request_not_supported );
            batchResponseDsml.addResponse( compareResponseDsml );
        }
    }
View Full Code Here

                break;

            case COMPARE_REQUEST:
                CompareResponse compareResponse = connection.compare( ( CompareRequest ) request );
                resultCode = compareResponse.getLdapResult().getResultCode();
                CompareResponseDsml compareResponseDsml = new CompareResponseDsml( connection.getCodecService(),
                    compareResponse );
                writeResponse( respWriter, compareResponseDsml );

                break;
View Full Code Here

                break;

            case COMPARE_REQUEST:
                CompareResponse compareResponse = connection.compare( ( CompareRequest ) request );
                resultCode = compareResponse.getLdapResult().getResultCode();
                CompareResponseDsml compareResponseDsml = new CompareResponseDsml( connection.getCodecService(),
                    compareResponse );
                writeResponse( respWriter, compareResponseDsml );

                break;
View Full Code Here

                break;

            case COMPARE_REQUEST:
                CompareResponse compareResponse = connection.compare( ( CompareRequest ) request );
                resultCode = compareResponse.getLdapResult().getResultCode();
                CompareResponseDsml compareResponseDsml = new CompareResponseDsml( connection.getCodecService(),
                    compareResponse );
                writeResponse( respWriter, compareResponseDsml );

                break;
View Full Code Here

        else if ( LdapConstants.COMPARE_RESPONSE == response.getMessageType() )
        {
            CompareResponse compareResponse = response.getCompareResponse();
            copyMessageIdAndControls( response, compareResponse );

            CompareResponseDsml authResponseDsml = new CompareResponseDsml( compareResponse );
            batchResponse.addResponse( authResponseDsml );
        }
        else if ( LdapConstants.DEL_RESPONSE == response.getMessageType() )
        {
            DelResponse delResponse = response.getDelResponse();
View Full Code Here

            AuthResponseDsml authResponseDsml = new AuthResponseDsml( response );
            authResponseDsml.toDsml( xmlResponse.getRootElement() );
        }
        else if ( LdapConstants.COMPARE_RESPONSE == response.getMessageType() )
        {
            CompareResponseDsml authResponseDsml = new CompareResponseDsml( response );
            authResponseDsml.toDsml( xmlResponse.getRootElement() );
        }
        else if ( LdapConstants.DEL_RESPONSE == response.getMessageType() )
        {
            DelResponseDsml delResponseDsml = new DelResponseDsml( response );
            delResponseDsml.toDsml( xmlResponse.getRootElement() );
View Full Code Here

     * Test parsing of a request with the principal attribute
     */
    @Test
    public void testRequestWithPrincipal()
    {
        Dsmlv2Parser parser = null;
        try
        {
            parser = newParser();

            parser.setInput( AuthRequestTest.class.getResource( "request_with_principal_attribute.xml" ).openStream(),
                "UTF-8" );

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

        BindRequest bindRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();

        assertEquals( "CN=Bob Rush,OU=Dev,DC=Example,DC=COM", bindRequest.getName() );
    }
View Full Code Here

     * Test parsing of a request with the (optional) requestID attribute
     */
    @Test
    public void testRequestWithRequestId()
    {
        Dsmlv2Parser parser = null;
        try
        {
            parser = newParser();

            parser.setInput( AuthRequestTest.class.getResource( "request_with_requestID_attribute.xml" ).openStream(),
                "UTF-8" );

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

        BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();

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

     * Test parsing of a request with a (optional) Control element
     */
    @Test
    public void testRequestWith1Control()
    {
        Dsmlv2Parser parser = null;
        try
        {
            parser = newParser();

            parser.setInput( AuthRequestTest.class.getResource( "request_with_1_control.xml" ).openStream(), "UTF-8" );

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

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

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

        Control control = controls.get( "1.2.840.113556.1.4.643" );
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.dsmlv2.reponse.CompareResponseDsml

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.