Package org.apache.directory.api.dsmlv2.reponse

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


     * @return the XML response in DSMLv2 Format
     * @throws XmlPullParserException if an error occurs in the parser
     */
    public String processDSML( String dsmlInput ) throws XmlPullParserException
    {
        parser = new Dsmlv2Parser( grammar );
        parser.setInput( dsmlInput );

        return processDSML();
    }
View Full Code Here


     * @throws XmlPullParserException if an error occurs in the parser
     * @throws FileNotFoundException if the file does not exist
     */
    public String processDSMLFile( String fileName ) throws XmlPullParserException, FileNotFoundException
    {
        parser = new Dsmlv2Parser( grammar );
        parser.setInputFile( fileName );

        return processDSML();
    }
View Full Code Here

     * @param respStream the output stream to which response will be written, skipped if null
     * @throws Exception If the processing fails
     */
    public void processDSMLFile( File file, OutputStream respStream ) throws Exception
    {
        parser = new Dsmlv2Parser( grammar );
        parser.setInputFile( file.getAbsolutePath() );

        processDSML( respStream );
    }
View Full Code Here

     * @param out the output stream to which DSML response will be written
     * @throws Exception If the processing fails
     */
    public void processDSML( InputStream inputStream, String inputEncoding, OutputStream out ) throws Exception
    {
        parser = new Dsmlv2Parser( grammar );
        parser.setInput( inputStream, inputEncoding );
        processDSML( out );
    }
View Full Code Here

        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();

        engine.processDSML( dsmlIn, byteOut );

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

        respParser.parseAllResponses();

        BatchResponseDsml batchResp = respParser.getBatchResponse();

        assertNotNull( batchResp );

        assertEquals( 101, batchResp.getRequestID() );
       
View Full Code Here

        engine.setGenerateSoapResp( false );
       
        String resp = byteOut.toString();

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

        respParser.parseAllResponses();

        BatchResponseDsml batchResp = respParser.getBatchResponse();

        assertNotNull( batchResp );
       
        assertEquals( 101, batchResp.getRequestID() );
       
View Full Code Here

    @Before
    public void setup()
    {
        connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
        engine = new Dsmlv2Engine( connection, "uid=admin,ou=system", "secret" );
    }
View Full Code Here

                return;

            case ADD_REQUEST:
                AddResponse response = connection.add( ( AddRequest ) request );
                resultCode = response.getLdapResult().getResultCode();
                AddResponseDsml addResponseDsml = new AddResponseDsml( connection.getCodecService(), response );
                writeResponse( respWriter, addResponseDsml );

                break;

            case BIND_REQUEST:
View Full Code Here

        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

        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

TOP

Related Classes of org.apache.directory.api.dsmlv2.reponse.ErrorResponse

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.