Package org.apache.directory.api.dsmlv2.request

Examples of org.apache.directory.api.dsmlv2.request.Dsmlv2Grammar


                getControls( request ), monitor, null );

        // Creating the response
        if ( batchResponseDsml != null )
        {
            ModDNResponseDsml modDNResponseDsml = new ModDNResponseDsml( codec );
            LdapResult ldapResult = modDNResponseDsml.getLdapResult();
            setLdapResultValuesFromMonitor( ldapResult, monitor, MessageTypeEnum.ADD_REQUEST );
            modDNResponseDsml.getLdapResult().setMatchedDn( request.getName() );
            batchResponseDsml.addResponse( modDNResponseDsml );
        }

        // Update cached entries
        Dn dn = request.getName();
View Full Code Here


                break;

            case MODIFYDN_REQUEST:
                ModifyDnResponse modifyDnResponse = connection.modifyDn( ( ModifyDnRequest ) request );
                resultCode = modifyDnResponse.getLdapResult().getResultCode();
                ModDNResponseDsml modDNResponseDsml = new ModDNResponseDsml( connection.getCodecService(),
                    modifyDnResponse );
                writeResponse( respWriter, modDNResponseDsml );

                break;
View Full Code Here

                break;

            case MODIFY_REQUEST:
                ModifyResponse modifyResponse = connection.modify( ( ModifyRequest ) request );
                resultCode = modifyResponse.getLdapResult().getResultCode();
                ModifyResponseDsml modifyResponseDsml = new ModifyResponseDsml( connection.getCodecService(),
                    modifyResponse );
                writeResponse( respWriter, modifyResponseDsml );

                break;
View Full Code Here

                getControls( request ), monitor, null );

        // Creating the response
        if ( batchResponseDsml != null )
        {
            ModifyResponseDsml modifyResponseDsml = new ModifyResponseDsml( codec );
            LdapResult ldapResult = modifyResponseDsml.getLdapResult();
            setLdapResultValuesFromMonitor( ldapResult, monitor, MessageTypeEnum.ADD_REQUEST );
            modifyResponseDsml.getLdapResult().setMatchedDn( request.getName() );
            batchResponseDsml.addResponse( modifyResponseDsml );
        }

        Dn dn = request.getName();
        IEntry e = browserConnection.getEntryFromCache( dn );
View Full Code Here

                break;

            case MODIFY_REQUEST:
                ModifyResponse modifyResponse = connection.modify( ( ModifyRequest ) request );
                resultCode = modifyResponse.getLdapResult().getResultCode();
                ModifyResponseDsml modifyResponseDsml = new ModifyResponseDsml( connection.getCodecService(),
                    modifyResponse );
                writeResponse( respWriter, modifyResponseDsml );

                break;
View Full Code Here

        assertNotNull( batchResp );

        assertEquals( 101, batchResp.getRequestID() );
       
        SearchResponse searchResp = ( SearchResponse ) batchResp.getCurrentResponse().getDecorated();

        assertEquals( 5, searchResp.getSearchResultEntryList().size() );
    }
View Full Code Here

        assertNotNull( batchResp );
       
        assertEquals( 101, batchResp.getRequestID() );
       
        SearchResponse searchResp = ( SearchResponse ) batchResp.getCurrentResponse().getDecorated();

        assertEquals( 5, searchResp.getSearchResultEntryList().size() );
    }
View Full Code Here

        BatchResponseDsml batchResp = respParser.getBatchResponse();

        assertNotNull( batchResp );

        SearchResponse searchResp = ( SearchResponse ) batchResp.getCurrentResponse().getDecorated();

        assertEquals( 5, searchResp.getSearchResultEntryList().size() );
    }
View Full Code Here

        BatchResponseDsml batchResp = respParser.getBatchResponse();

        assertNotNull( batchResp );

        SearchResponse searchResp = ( SearchResponse ) batchResp.getCurrentResponse().getDecorated();

        assertEquals( 5, searchResp.getSearchResultEntryList().size() );
    }
View Full Code Here

                break;

            case SEARCH_REQUEST:
                SearchCursor searchResponses = connection.search( ( SearchRequest ) request );

                SearchResponseDsml searchResponseDsml = new SearchResponseDsml( connection.getCodecService() );

                if ( respWriter != null )
                {
                    StringBuilder sb = new StringBuilder();
                    sb.append( "<searchResponse" );

                    if ( request.getDecorated().getMessageId() > 0 )
                    {
                        sb.append( " requestID=\"" );
                        sb.append( request.getDecorated().getMessageId() );
                        sb.append( '"' );
                    }

                    sb.append( '>' );

                    respWriter.write( sb.toString() );
                }

                while ( searchResponses.next() )
                {
                    Response searchResponse = searchResponses.get();

                    if ( searchResponse.getType() == MessageTypeEnum.SEARCH_RESULT_ENTRY )
                    {
                        SearchResultEntry searchResultEntry = ( SearchResultEntry ) searchResponse;

                        SearchResultEntryDsml searchResultEntryDsml = new SearchResultEntryDsml(
                            connection.getCodecService(), searchResultEntry );
                        searchResponseDsml = new SearchResponseDsml( connection.getCodecService(),
                            searchResultEntryDsml );

                        if ( respWriter != null )
                        {
                            writeResponse( respWriter, searchResultEntryDsml );
                        }
                        else
                        {
                            searchResponseDsml.addResponse( searchResultEntryDsml );
                        }
                    }
                    else if ( searchResponse.getType() == MessageTypeEnum.SEARCH_RESULT_REFERENCE )
                    {
                        SearchResultReference searchResultReference = ( SearchResultReference ) searchResponse;

                        SearchResultReferenceDsml searchResultReferenceDsml = new SearchResultReferenceDsml(
                            connection.getCodecService(), searchResultReference );
                        searchResponseDsml = new SearchResponseDsml( connection.getCodecService(),
                            searchResultReferenceDsml );

                        if ( respWriter != null )
                        {
                            writeResponse( respWriter, searchResultReferenceDsml );
                        }
                        else
                        {
                            searchResponseDsml.addResponse( searchResultReferenceDsml );
                        }
                    }
                }

                SearchResultDone srDone = searchResponses.getSearchResultDone();

                if ( srDone != null )
                {
                    resultCode = srDone.getLdapResult().getResultCode();

                    SearchResultDoneDsml srdDsml = new SearchResultDoneDsml( connection.getCodecService(), srDone );

                    if ( respWriter != null )
                    {
                        writeResponse( respWriter, srdDsml );
                        respWriter.write( "</searchResponse>" );
                    }
                    else
                    {
                        searchResponseDsml.addResponse( srdDsml );
                        batchResponse.addResponse( searchResponseDsml );
                    }
                }

                break;
View Full Code Here

TOP

Related Classes of org.apache.directory.api.dsmlv2.request.Dsmlv2Grammar

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.