Examples of SearchResultEntryDecorator


Examples of org.apache.directory.shared.ldap.codec.decorators.SearchResultEntryDecorator

    /**
     * {@inheritDoc}
     */
    public void action( LdapMessageContainer<SearchResultEntryDecorator> container )
    {
        SearchResultEntryDecorator searchResultEntry = container.getMessage();

        TLV tlv = container.getCurrentTLV();

        // Store the value
        Object value = null;

        if ( tlv.getLength() == 0 )
        {
            searchResultEntry.addAttributeValue( "" );

            LOG.debug( "The attribute value is null" );
        }
        else
        {
            if ( container.isBinary( searchResultEntry.getCurrentAttribute().getId() ) )
            {
                value = tlv.getValue().getData();

                if ( IS_DEBUG )
                {
                    LOG.debug( "Attribute value {}", Strings.dumpBytes((byte[]) value) );
                }
            }
            else
            {
                value = Strings.utf8ToString(tlv.getValue().getData());

                LOG.debug( "Attribute value {}", value );
            }

            searchResultEntry.addAttributeValue( value );
        }

        // We can have an END transition
        container.setGrammarEndAllowed( 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.