Examples of BatchResponseDsml


Examples of org.apache.directory.api.dsmlv2.reponse.BatchResponseDsml

        Dsmlv2ResponseParser respParser = new Dsmlv2ResponseParser( LdapApiServiceFactory.getSingleton() );
        respParser.setInput( byteOut.toString() );

        respParser.parseAllResponses();

        BatchResponseDsml batchResp = respParser.getBatchResponse();

        assertNotNull( batchResp );

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

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

Examples of org.apache.directory.api.dsmlv2.reponse.BatchResponseDsml

        Dsmlv2ResponseParser respParser = new Dsmlv2ResponseParser( LdapApiServiceFactory.getSingleton() );
        respParser.setInput( resp );

        respParser.parseAllResponses();

        BatchResponseDsml batchResp = respParser.getBatchResponse();

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

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

Examples of org.apache.directory.api.dsmlv2.reponse.BatchResponseDsml

     */
    private String processAsDsmlResponse( StudioNamingEnumeration ne, StudioProgressMonitor monitor )
        throws NamingException, LdapURLEncodingException, LdapException
    {
        // Creating the batch reponse
        BatchResponseDsml batchResponse = new BatchResponseDsml();

        processAsDsmlResponse( ne, batchResponse, monitor, searchParameter );

        // Returning the associated DSML
        return batchResponse.toDsml();
    }
View Full Code Here

Examples of org.apache.directory.api.dsmlv2.reponse.BatchResponseDsml

            // Getting the batch request
            BatchRequestDsml batchRequest = parser.getBatchRequest();

            // Creating a DSML batch response (only if needed)
            BatchResponseDsml batchResponseDsml = null;
            if ( responseFile != null )
            {
                batchResponseDsml = new BatchResponseDsml();
            }

            // Setting the errors counter
            int errorsCount = 0;

            // Creating a dummy monitor that will be used to check if something
            // went wrong when executing the request
            StudioProgressMonitor dummyMonitor = new StudioProgressMonitor( monitor );

            // Processing each request
            List<DsmlDecorator<? extends Request>> requests = batchRequest.getRequests();
            for ( DsmlDecorator<? extends Request> request : requests )
            {
                // Processing the request
                processRequest( request, batchResponseDsml, dummyMonitor );

                // Verifying if any error has been reported
                if ( dummyMonitor.errorsReported() )
                {
                    errorsCount++;
                }

                dummyMonitor.reset();
            }

            // Writing the DSML response file to its final destination file.
            if ( responseFile != null )
            {
                FileOutputStream fos = new FileOutputStream( responseFile );
                OutputStreamWriter osw = new OutputStreamWriter( fos, "UTF-8" ); //$NON-NLS-1$
                BufferedWriter bufferedWriter = new BufferedWriter( osw );
                bufferedWriter.write( batchResponseDsml.toDsml() );
                bufferedWriter.close();
                osw.close();
                fos.close();
            }
View Full Code Here

Examples of org.apache.directory.ldapstudio.dsmlv2.reponse.BatchResponseDsml

     * @return
     *      the XML response in DSMLv2 Format
     */
    private String processDSML()
    {
        batchResponse = new BatchResponseDsml();

        // Binding to LDAP Server
        try
        {
            bind( 1 );
View Full Code Here

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

            // Getting the batch request
            BatchRequest batchRequest = parser.getBatchRequest();

            // Creating a DSML batch response (only if needed)
            BatchResponseDsml batchResponseDsml = null;
            if ( responseFile != null )
            {
                batchResponseDsml = new BatchResponseDsml();
            }

            // Setting the errors counter
            int errorsCount = 0;

            // Creating a dummy monitor that will be used to check if something
            // went wrong when executing the request
            StudioProgressMonitor dummyMonitor = new StudioProgressMonitor( monitor );

            // Processing each request
            List<?> requests = batchRequest.getRequests();
            for ( Object request : requests )
            {
                // Processing the request
                processRequest( request, batchResponseDsml, dummyMonitor );

                // Verifying if any error has been reported
                if ( dummyMonitor.errorsReported() )
                {
                    errorsCount++;
                }

                dummyMonitor.reset();
            }

            // Writing the DSML response file to its final destination file.
            if ( responseFile != null )
            {
                FileOutputStream fos = new FileOutputStream( responseFile );
                OutputStreamWriter osw = new OutputStreamWriter( fos, "UTF-8" );
                BufferedWriter bufferedWriter = new BufferedWriter( osw );
                bufferedWriter.write( batchResponseDsml.toDsml() );
                bufferedWriter.close();
                osw.close();
                fos.close();
            }
View Full Code Here

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

     */
    private String processAsDsmlResponse( StudioNamingEnumeration ne, StudioProgressMonitor monitor )
        throws NamingException, LdapURLEncodingException
    {
        // Creating the batch reponse
        BatchResponseDsml batchResponse = new BatchResponseDsml();

        processAsDsmlResponse( ne, batchResponse, monitor, searchParameter );

        // Returning the associated DSML
        return batchResponse.toDsml();
    }
View Full Code Here

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

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

        BatchResponseDsml batchResponse = parser.getBatchResponse();

        assertEquals( 1, batchResponse.getResponses().size() );

        DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();

        if ( response instanceof ModifyResponse )
        {
            assertTrue( true );
        }
View Full Code Here

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

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

        BatchResponseDsml batchResponse = parser.getBatchResponse();

        assertEquals( 1, batchResponse.getResponses().size() );

        DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();

        if ( response.getDecorated() instanceof SearchResponse )
        {
            assertTrue( true );
        }
View Full Code Here

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

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

        BatchResponseDsml batchResponse = parser.getBatchResponse();

        assertEquals( 2, batchResponse.getResponses().size() );

        DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();

        if ( response instanceof AddResponse )
        {
            assertTrue( true );
        }
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.