Package org.apache.directory.shared.ldap.model.message

Examples of org.apache.directory.shared.ldap.model.message.SearchResultReference


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

        SearchResultReference searchResultReference = ( ( SearchResponse ) parser.getBatchResponse()
            .getCurrentResponse().getDecorated() ).getCurrentSearchResultReference();

        Collection<String> references = searchResultReference.getReferral().getLdapUrls();

        assertEquals( 2, references.size() );

        try
        {
View Full Code Here


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

                break;

            case SEARCH_RESULT_REFERENCE:
                // Store the response into the responseQueue
                SearchResultReference searchResultReference = ( SearchResultReference ) response;

                searchFuture = ( SearchFuture ) responseFuture;

                if ( LOG.isDebugEnabled() )
                {
View Full Code Here

     * @param searchResultReferenceDecorator The SearchResultReference decorator
     * @return The PDU.
     */
    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
    {
        SearchResultReference searchResultReference = getDecorated();
        try
        {
            // The SearchResultReference Tag
            buffer.put( LdapConstants.SEARCH_RESULT_REFERENCE_TAG );
            buffer.put( TLV.getBytes( getSearchResultReferenceLength() ) );

            // The referrals, if any
            Referral referral = searchResultReference.getReferral();

            if ( referral != null )
            {
                // Each referral
                for ( byte[] ldapUrlBytes : referral.getLdapUrlsBytes() )
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void action( LdapMessageContainer<SearchResultReferenceDecorator> container ) throws DecoderException
    {
        SearchResultReference searchResultReference = container.getMessage();

        // Get the Value and store it in the BindRequest
        TLV tlv = container.getCurrentTLV();

        // Get the referral, or create it if not existing
        Referral referral = searchResultReference.getReferral();

        if ( referral == null )
        {
            referral = new ReferralImpl();
            searchResultReference.setReferral( referral );
        }

        // We have to handle the special case of a 0 length list of referrals
        LdapUrl url = LdapUrl.EMPTY_URL;

View Full Code Here

        {
            de.printStackTrace();
            fail( de.getMessage() );
        }

        SearchResultReference searchResultReference = ldapMessageContainer.getMessage();

        assertEquals( 1, searchResultReference.getMessageId() );

        Set<String> ldapUrlsSet = new HashSet<String>();

        for ( int i = 0; i < ldapUrls.length; i++ )
        {
            ldapUrlsSet.add( Strings.utf8ToString( ldapUrls[i].getBytes() ) );
        }

        Referral referral = searchResultReference.getReferral();

        assertNotNull( referral );

        for ( String ldapUrl : referral.getLdapUrls() )
        {
View Full Code Here

            fail( de.getMessage() );
        }

        stream.flip();

        SearchResultReference searchResultReference = ldapMessageContainer.getMessage();

        assertEquals( 1, searchResultReference.getMessageId() );

        Set<String> ldapUrlsSet = new HashSet<String>();

        for ( int i = 0; i < ldapUrls.length; i++ )
        {
            ldapUrlsSet.add( Strings.utf8ToString( ldapUrls[i].getBytes() ) );
        }

        Referral referral = searchResultReference.getReferral();

        assertNotNull( referral );

        for ( String ldapUrl : referral.getLdapUrls() )
        {
            if ( ldapUrlsSet.contains( ldapUrl ) )
            {
                ldapUrlsSet.remove( ldapUrl );
            }
            else
            {
                fail( ldapUrl.toString() + " is not present" );
            }
        }

        assertTrue( ldapUrlsSet.size() == 0 );

        // Check the Control
        Map<String, Control> controls = searchResultReference.getControls();

        assertEquals( 1, controls.size() );

        @SuppressWarnings("unchecked")
        CodecControl<Control> control = ( org.apache.directory.shared.ldap.codec.api.CodecControl<Control> ) controls
View Full Code Here

        {
            de.printStackTrace();
            fail( de.getMessage() );
        }

        SearchResultReference searchResultReference = ldapMessageContainer.getMessage();

        assertEquals( 1, searchResultReference.getMessageId() );

        Referral referral = searchResultReference.getReferral();

        assertNotNull( referral );

        for ( String ldapUrl : referral.getLdapUrls() )
        {
View Full Code Here

                break;

            case SEARCH_RESULT_REFERENCE:
                // Store the response into the responseQueue
                SearchResultReference searchResultReference = ( SearchResultReference ) response;

                searchFuture = ( SearchFuture ) responseFuture;

                if ( LOG.isDebugEnabled() )
                {
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void action( LdapMessageContainer<SearchResultReferenceDecorator> container ) throws DecoderException
    {
        SearchResultReference searchResultReference = container.getMessage();

        // Get the Value and store it in the BindRequest
        TLV tlv = container.getCurrentTLV();

        // Get the referral, or create it if not existing
        Referral referral = searchResultReference.getReferral();

        if ( referral == null )
        {
            referral = new ReferralImpl();
            searchResultReference.setReferral( referral );
        }

        // We have to handle the special case of a 0 length list of referrals
        LdapURL url = LdapURL.EMPTY_URL;

View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.message.SearchResultReference

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.