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

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


            case INTERMEDIATE_RESPONSE:
                decorator = new IntermediateResponseDecorator( codec, ( IntermediateResponse ) decoratedMessage );
                break;

            case MODIFY_REQUEST:
                decorator = new ModifyRequestDecorator( codec, ( ModifyRequest ) decoratedMessage );
                break;

            case MODIFY_RESPONSE:
                decorator = new ModifyResponseDecorator( codec, ( ModifyResponse ) decoratedMessage );
                break;
View Full Code Here


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

        TLV tlv = container.getCurrentTLV();

        // Decode the operation type
        int operation = 0;

        try
        {
            operation = IntegerDecoder.parse( tlv.getValue(), 0, 2 );
        }
        catch ( IntegerDecoderException ide )
        {
            String msg = I18n.err( I18n.ERR_04082, Strings.dumpBytes( tlv.getValue().getData() ) );
            LOG.error( msg );

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( msg );
        }

        // Store the current operation.
        modifyRequestDecorator.setCurrentOperation( operation );

        if ( IS_DEBUG )
        {
            switch ( operation )
            {
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void action( LdapMessageContainer<ModifyRequestDecorator> container ) throws DecoderException
    {
        ModifyRequestDecorator modifyRequestDecorator = container.getMessage();
        ModifyRequest modifyRequest = modifyRequestDecorator.getDecorated();

        TLV tlv = container.getCurrentTLV();

        // Store the value. It can't be null
        String type = null;

        if ( tlv.getLength() == 0 )
        {
            String msg = I18n.err( I18n.ERR_04083 );
            LOG.error( msg );

            ModifyResponseImpl response = new ModifyResponseImpl( modifyRequest.getMessageId() );
            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
                modifyRequest.getName(), null );
        }
        else
        {
            type = Strings.utf8ToString( tlv.getValue().getData() );
            modifyRequestDecorator.addAttributeTypeAndValues( type );
        }

        if ( IS_DEBUG )
        {
            LOG.debug( "Modifying type : {}", type );
View Full Code Here

            case INTERMEDIATE_RESPONSE:
                decorator = new IntermediateResponseDecorator( codec, ( IntermediateResponse ) decoratedMessage );
                break;

            case MODIFY_REQUEST:
                decorator = new ModifyRequestDecorator( codec, ( ModifyRequest ) decoratedMessage );
                break;

            case MODIFY_RESPONSE:
                decorator = new ModifyResponseDecorator( codec, ( ModifyResponse ) decoratedMessage );
                break;
View Full Code Here

    public void action( LdapMessageContainer<ModifyRequestDecorator> container )
    {
        // Now, we can allocate the ModifyRequest Object
        ModifyRequest internalModifyRequest = new ModifyRequestImpl();
        internalModifyRequest.setMessageId( container.getMessageId() );
        ModifyRequestDecorator modifyRequestDecorator = new ModifyRequestDecorator(
            container.getLdapCodecService(), internalModifyRequest );
        container.setMessage( modifyRequestDecorator );
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void action( LdapMessageContainer<ModifyRequestDecorator> container ) throws DecoderException
    {
        ModifyRequestDecorator modifyRequestDecorator = container.getMessage();
        ModifyRequest modifyRequest = modifyRequestDecorator.getDecorated();

        TLV tlv = container.getCurrentTLV();

        Dn object = Dn.EMPTY_DN;

        // Store the value.
        if ( tlv.getLength() == 0 )
        {
            ( modifyRequestDecorator.getDecorated() ).setName( object );
        }
        else
        {
            byte[] dnBytes = tlv.getValue().getData();
            String dnStr = Strings.utf8ToString( dnBytes );
View Full Code Here

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

        TLV tlv = container.getCurrentTLV();

        // Store the value. It can't be null
        byte[] value = StringConstants.EMPTY_BYTES;

        try
        {
            if ( tlv.getLength() == 0 )
            {
                modifyRequestDecorator.addAttributeValue( "" );
            }
            else
            {
                value = tlv.getValue().getData();

                if ( container.isBinary( modifyRequestDecorator.getCurrentAttributeType() ) )
                {
                    modifyRequestDecorator.addAttributeValue( value );
                }
                else
                {
                    modifyRequestDecorator.addAttributeValue( Strings.utf8ToString( ( byte[] ) value ) );
                }
            }
        }
        catch ( LdapException le )
        {
View Full Code Here

            case INTERMEDIATE_RESPONSE:
                decorator = new IntermediateResponseDecorator( codec, ( IntermediateResponse ) decoratedMessage );
                break;

            case MODIFY_REQUEST:
                decorator = new ModifyRequestDecorator( codec, ( ModifyRequest ) decoratedMessage );
                break;

            case MODIFY_RESPONSE:
                decorator = new ModifyResponseDecorator( codec, ( ModifyResponse ) decoratedMessage );
                break;
View Full Code Here

TOP

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

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.