Package org.apache.directory.api.ldap.codec.decorators

Examples of org.apache.directory.api.ldap.codec.decorators.SearchRequestDecorator


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

        TLV tlv = container.getCurrentTLV();

        // We can allocate the Attribute Value Assertion
        PresentFilter presentFilter = new PresentFilter( container.getTlvId() );

        // add the filter to the request filter
        searchRequestDecorator.addCurrentFilter( presentFilter );
        searchRequestDecorator.setTerminalFilter( presentFilter );

        String value = Strings.utf8ToString( tlv.getValue().getData() );

        if ( Strings.isEmpty( value ) )
        {
            presentFilter.setAttributeDescription( "" );
        }
        else
        {
            // Store the value.
            String type = Strings.utf8ToString( tlv.getValue().getData() );
            presentFilter.setAttributeDescription( type );
        }

        // We now have to get back to the nearest filter which is
        // not terminal.
        searchRequestDecorator.unstackFilters( container );

        if ( IS_DEBUG )
        {
            LOG.debug( "Initialize Present filter" );
        }
View Full Code Here


        // Now, we can allocate the SearchRequest Object
        TLV tlv = container.getCurrentTLV();

        SearchRequest internalSearchRequest = new SearchRequestImpl();
        internalSearchRequest.setMessageId( container.getMessageId() );
        SearchRequestDecorator searchRequest = new SearchRequestDecorator(
            container.getLdapCodecService(), internalSearchRequest );

        searchRequest.setTlvId( tlv.getId() );
        container.setMessage( searchRequest );

        LOG.debug( "Search Request" );
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void action( LdapMessageContainer<SearchRequestDecorator> container ) throws DecoderException
    {
        SearchRequestDecorator searchRequestDecorator = container.getMessage();
        SearchRequest searchRequest = searchRequestDecorator.getDecorated();

        TLV tlv = container.getCurrentTLV();

        // We have to check that this is a correct Dn
        Dn baseObject = null;
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void action( LdapMessageContainer<SearchRequestDecorator> container ) throws DecoderException
    {
        SearchRequestDecorator searchRequestDecorator = container.getMessage();
        TLV tlv = container.getCurrentTLV();
        String attributeDescription = null;

        if ( tlv.getLength() != 0 )
        {
            attributeDescription = Strings.utf8ToString( tlv.getValue().getData() );

            // If the attributeDescription is empty, we won't add it
            if ( !Strings.isEmpty( attributeDescription.trim() ) )
            {
                searchRequestDecorator.getDecorated().addAttributes( attributeDescription );
            }
        }

        // We can have an END transition
        container.setGrammarEndAllowed( true );
View Full Code Here

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

        // We can allocate the Attribute Value Assertion
        Filter filter = new AttributeValueAssertionFilter( container.getTlvId(),
            LdapConstants.GREATER_OR_EQUAL_FILTER );

        searchRequestDecorator.addCurrentFilter( filter );

        // Store the filter structure that still has to be
        // fulfilled
        searchRequestDecorator.setTerminalFilter( filter );

        if ( IS_DEBUG )
        {
            LOG.debug( "Initialize Greater Or Equal filter" );
        }
View Full Code Here

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

        // We can allocate the Attribute Value Assertion
        Filter filter = new AttributeValueAssertionFilter( container.getTlvId(),
            LdapConstants.APPROX_MATCH_FILTER );

        searchRequestDecorator.addCurrentFilter( filter );

        // Store the filter structure that still has to be
        // fulfilled
        searchRequestDecorator.setTerminalFilter( filter );

        if ( IS_DEBUG )
        {
            LOG.debug( "Initialize Approx Match filter" );
        }
View Full Code Here

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

        // We can allocate the ExtensibleMatch Filter
        Filter extensibleMatchFilter = new ExtensibleMatchFilter( container.getTlvId() );

        searchRequestDecorator.addCurrentFilter( extensibleMatchFilter );
        searchRequestDecorator.setTerminalFilter( extensibleMatchFilter );

        if ( IS_DEBUG )
        {
            LOG.debug( "Initialize Extensible Match filter" );
        }
View Full Code Here

            case MODIFYDN_RESPONSE:
                decorator = new ModifyDnResponseDecorator( codec, ( ModifyDnResponse ) decoratedMessage );
                break;

            case SEARCH_REQUEST:
                decorator = new SearchRequestDecorator( codec, ( SearchRequest ) decoratedMessage );
                break;

            case SEARCH_RESULT_DONE:
                decorator = new SearchResultDoneDecorator( codec, ( SearchResultDone ) decoratedMessage );
                break;
View Full Code Here

            LdapConstants.MATCHING_RULE_ID_TAG, new GrammarAction<LdapMessageContainer<SearchRequestDecorator>>(
                "Store matching rule Value" )
            {
                public void action( LdapMessageContainer<SearchRequestDecorator> container ) throws DecoderException
                {
                    SearchRequestDecorator searchRequest = container.getMessage();

                    TLV tlv = container.getCurrentTLV();

                    // Store the value.
                    ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter )
                        searchRequest.getTerminalFilter();

                    if ( tlv.getLength() == 0 )
                    {
                        String msg = I18n.err( I18n.ERR_04109 );
                        LOG.error( msg );
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.codec.decorators.SearchRequestDecorator

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.