Examples of AbandonRequestDecorator


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

        MessageDecorator<?> decorator = null;

        switch ( decoratedMessage.getType() )
        {
            case ABANDON_REQUEST:
                decorator = new AbandonRequestDecorator( codec, ( AbandonRequest ) decoratedMessage );
                break;

            case ADD_REQUEST:
                decorator = new AddRequestDecorator( codec, ( AddRequest ) decoratedMessage );
                break;
View Full Code Here

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

        MessageDecorator<?> decorator = null;

        switch ( decoratedMessage.getType() )
        {
            case ABANDON_REQUEST:
                decorator = new AbandonRequestDecorator( codec, ( AbandonRequest ) decoratedMessage );
                break;

            case ADD_REQUEST:
                decorator = new AddRequestDecorator( codec, ( AddRequest ) decoratedMessage );
                break;
View Full Code Here

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

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

        // Check that everything is OK
        AbandonRequestDecorator abandonRequest = ldapMessageContainer.getMessage();

        // Copy the message
        AbandonRequest internalAbandonRequest = new AbandonRequestImpl( abandonRequest.getAbandoned() );
        internalAbandonRequest.setMessageId( abandonRequest.getMessageId() );

        assertEquals( 3, abandonRequest.getMessageId() );
        assertEquals( 2, abandonRequest.getAbandoned() );

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

        assertEquals( 4, controls.size() );

        CodecControl<? extends Control> control = ( org.apache.directory.api.ldap.codec.api.CodecControl<?> ) controls
            .get( "1.3.6.1.5.5.1" );
View Full Code Here

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

    public void action( LdapMessageContainer<AbandonRequestDecorator> container ) throws DecoderException
    {
        // Create the AbandonRequest LdapMessage instance and store it in the container
        AbandonRequest internalAbandonRequest = new AbandonRequestImpl();
        internalAbandonRequest.setMessageId( container.getMessageId() );
        AbandonRequestDecorator abandonRequest = new AbandonRequestDecorator(
            container.getLdapCodecService(), internalAbandonRequest );
        container.setMessage( abandonRequest );

        // The current TLV should be a integer
        // We get it and store it in MessageId
        TLV tlv = container.getCurrentTLV();

        BerValue value = tlv.getValue();

        if ( ( value == null ) || ( value.getData() == null ) )
        {
            String msg = I18n.err( I18n.ERR_04075 );
            LOG.error( msg );

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

        try
        {
            int abandonnedMessageId = IntegerDecoder.parse( value, 0, Integer.MAX_VALUE );

            abandonRequest.setAbandoned( abandonnedMessageId );

            if ( IS_DEBUG )
            {
                LOG
                    .debug( "AbandonMessage Id has been decoded : {}", Integer
View Full Code Here

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

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

        // Check that everything is OK
        AbandonRequestDecorator abandonRequest = ldapMessageContainer.getMessage();

        // Copy the message
        AbandonRequest internalAbandonRequest = new AbandonRequestImpl( abandonRequest.getAbandoned() );
        internalAbandonRequest.setMessageId( abandonRequest.getMessageId() );

        assertEquals( 3, abandonRequest.getMessageId() );
        assertEquals( 2, abandonRequest.getAbandoned() );

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

        assertEquals( 4, controls.size() );

        CodecControl<Control> control = ( org.apache.directory.api.ldap.codec.api.CodecControl<Control> ) controls
            .get( "1.3.6.1.5.5.1" );
View Full Code Here

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

        MessageDecorator<?> decorator = null;

        switch ( decoratedMessage.getType() )
        {
            case ABANDON_REQUEST:
                decorator = new AbandonRequestDecorator( codec, ( AbandonRequest ) decoratedMessage );
                break;

            case ADD_REQUEST:
                decorator = new AddRequestDecorator( codec, ( AddRequest ) decoratedMessage );
                break;
View Full Code Here

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

    public void action( LdapMessageContainer<AbandonRequestDecorator> container ) throws DecoderException
    {
        // Create the AbandonRequest LdapMessage instance and store it in the container
        AbandonRequest internalAbandonRequest = new AbandonRequestImpl();
        internalAbandonRequest.setMessageId( container.getMessageId() );
        AbandonRequestDecorator abandonRequest = new AbandonRequestDecorator(
            container.getLdapCodecService(), internalAbandonRequest );
        container.setMessage( abandonRequest );

        // The current TLV should be a integer
        // We get it and store it in MessageId
        TLV tlv = container.getCurrentTLV();

        Value value = tlv.getValue();

        if ( ( value == null ) || ( value.getData() == null ) )
        {
            String msg = I18n.err( I18n.ERR_04075 );
            LOG.error( msg );

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

        try
        {
            int abandonnedMessageId = IntegerDecoder.parse( value, 0, Integer.MAX_VALUE );

            abandonRequest.setAbandoned( abandonnedMessageId );

            if ( IS_DEBUG )
            {
                LOG
                    .debug( "AbandonMessage Id has been decoded : {}", Integer
View Full Code Here

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

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

        // Check that everything is OK
        AbandonRequestDecorator abandonRequest = ldapMessageContainer.getMessage();

        // Copy the message
        AbandonRequest internalAbandonRequest = new AbandonRequestImpl( abandonRequest.getAbandoned() );
        internalAbandonRequest.setMessageId( abandonRequest.getMessageId() );

        assertEquals( 3, abandonRequest.getMessageId() );
        assertEquals( 2, abandonRequest.getAbandoned() );

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

        assertEquals( 4, controls.size() );

        CodecControl<Control> control = (org.apache.directory.shared.ldap.codec.api.CodecControl<Control> ) controls.get( "1.3.6.1.5.5.1" );
        assertEquals( "1.3.6.1.5.5.1", control.getOid() );
View Full Code Here

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

        MessageDecorator<?> decorator = null;
       
        switch ( decoratedMessage.getType() )
        {
            case ABANDON_REQUEST:
                decorator = new AbandonRequestDecorator( codec, ( AbandonRequest ) decoratedMessage );
                break;

            case ADD_REQUEST:
                decorator = new AddRequestDecorator( codec, ( AddRequest ) decoratedMessage );
                break;
View Full Code Here

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

    public void action( LdapMessageContainer<AbandonRequestDecorator> container ) throws DecoderException
    {
        // Create the AbandonRequest LdapMessage instance and store it in the container
        AbandonRequest internalAbandonRequest = new AbandonRequestImpl();
        internalAbandonRequest.setMessageId( container.getMessageId() );
        AbandonRequestDecorator abandonRequest = new AbandonRequestDecorator(
            container.getLdapCodecService(), internalAbandonRequest );
        container.setMessage( abandonRequest );

        // The current TLV should be a integer
        // We get it and store it in MessageId
        TLV tlv = container.getCurrentTLV();

        Value value = tlv.getValue();

        if ( ( value == null ) || ( value.getData() == null ) )
        {
            String msg = I18n.err( I18n.ERR_04075 );
            LOG.error( msg );

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

        try
        {
            int abandonnedMessageId = IntegerDecoder.parse( value, 0, Integer.MAX_VALUE );

            abandonRequest.setAbandoned( abandonnedMessageId );

            if ( IS_DEBUG )
            {
                LOG
                    .debug( "AbandonMessage Id has been decoded : {}", Integer
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.