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

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


                    }
                    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 )
View Full Code Here


            new Dn( searchResult.getNameInNamespace() ) );

        if ( isReferral( entry ) )
        {
            // The search result is a referral
            SearchResultReferenceDsml srr = new SearchResultReferenceDsml( codec );

            // Getting the 'ref' attribute
            Attribute refAttribute = entry.get( ExportDsmlRunnable.REF_ATTRIBUTETYPE_NAME );
            if ( refAttribute == null )
            {
                // If we did not get it by its name, let's get it by its OID
                refAttribute = entry.get( ExportDsmlRunnable.REF_ATTRIBUTETYPE_OID );
            }

            // Adding references
            if ( refAttribute != null )
            {
                for ( Iterator<Value<?>> iterator = refAttribute.iterator(); iterator.hasNext(); )
                {
                    Value<?> value = ( Value<?> ) iterator.next();

                    srr.addSearchResultReference( new LdapUrl( ( String ) value.getValue() ) );
                }
            }

            return srr;
        }
View Full Code Here

                    }
                    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 )
View Full Code Here

                    }
                    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 )
View Full Code Here

                    }
                    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 )
View Full Code Here

                else if ( LdapConstants.SEARCH_RESULT_REFERENCE == response.getMessageType() )
                {
                    SearchResultReference srr = response.getSearchResultReference();
                    copyMessageIdAndControls( response, srr );

                    SearchResultReferenceDsml searchResultReferenceDsml = new SearchResultReferenceDsml( srr );
                    searchResponseDsml.addResponse( searchResultReferenceDsml );
                }

                response = readResponse( bb );
            }
View Full Code Here

                    SearchResultEntryDsml searchResultEntryDsml = new SearchResultEntryDsml( response );
                    searchResultEntryDsml.toDsml( searchResponse );
                }
                else if ( LdapConstants.SEARCH_RESULT_REFERENCE == response.getMessageType() )
                {
                    SearchResultReferenceDsml searchResultReferenceDsml = new SearchResultReferenceDsml( response );
                    searchResultReferenceDsml.toDsml( searchResponse );
                }

                response = readResponse( bb );
            }
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.SearchResultReferenceDsml

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.