Package org.apache.directory.shared.asn1.ber.tlv

Examples of org.apache.directory.shared.asn1.ber.tlv.Value


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

        Value value = tlv.getValue();
        ResultCodeEnum resultCode = ResultCodeEnum.SUCCESS;

        try
        {
            resultCode = ResultCodeEnum.getResultCode( IntegerDecoder.parse(value, 0, ResultCodeEnum.UNKNOWN
                    .getResultCode()) );
        }
        catch ( IntegerDecoderException ide )
        {
            LOG.error( I18n.err( I18n.ERR_04018, Strings.dumpBytes(value.getData()), ide.getMessage() ) );

            throw new DecoderException( ide.getMessage() );
        }

        // Treat the 'normal' cases !
View Full Code Here


                UniversalTag.INTEGER.getValue(),
                new GrammarAction<PersistentSearchContainer>( "Set PSearchControl changeTypes" )
            {
                public void action( PersistentSearchContainer container ) throws DecoderException
                {
                    Value value = container.getCurrentTLV().getValue();

                    try
                    {
                        // Check that the value is into the allowed interval
                        int changeTypes = IntegerDecoder.parse( value,
                            PersistentSearch.CHANGE_TYPES_MIN,
                            PersistentSearch.CHANGE_TYPES_MAX );
                       
                        if ( IS_DEBUG )
                        {
                            LOG.debug( "changeTypes = " + changeTypes );
                        }

                        container.getPersistentSearchDecorator().setChangeTypes( changeTypes );
                    }
                    catch ( IntegerDecoderException e )
                    {
                        String msg = I18n.err( I18n.ERR_04051 );
                        LOG.error( msg, e );
                        throw new DecoderException( msg );
                    }
                }
            } );

        /**
         * Transition from Change types to Changes only
         * PSearch ::= SEQUENCE OF {
         *     ...
         *     changeOnly   BOOLEAN,
         *     ...
         *    
         * Stores the change only flag
         */
        super.transitions[ PersistentSearchStates.CHANGE_TYPES_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] =
            new GrammarTransition( PersistentSearchStates.CHANGE_TYPES_STATE,
                                    PersistentSearchStates.CHANGES_ONLY_STATE, UniversalTag.BOOLEAN.getValue(),
                new GrammarAction<PersistentSearchContainer>( "Set PSearchControl changesOnly" )
            {
                public void action( PersistentSearchContainer container ) throws DecoderException
                {
                    Value value = container.getCurrentTLV().getValue();

                    try
                    {
                        boolean changesOnly = BooleanDecoder.parse( value );

                        if ( IS_DEBUG )
                        {
                            LOG.debug( "changesOnly = " + changesOnly );
                        }

                        container.getPersistentSearchDecorator().setChangesOnly( changesOnly );
                    }
                    catch ( BooleanDecoderException e )
                    {
                        String msg = I18n.err( I18n.ERR_04052 );
                        LOG.error( msg, e );
                        throw new DecoderException( msg );
                    }
                }
            } );

        /**
         * Transition from Change types to Changes only
         * PSearch ::= SEQUENCE OF {
         *     ...
         *     returnECs    BOOLEAN
         * }
         *    
         * Stores the return ECs flag
         */
        super.transitions[ PersistentSearchStates.CHANGES_ONLY_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] =
            new GrammarTransition( PersistentSearchStates.CHANGES_ONLY_STATE,
                                    PersistentSearchStates.RETURN_ECS_STATE, UniversalTag.BOOLEAN.getValue(),
                new GrammarAction<PersistentSearchContainer>( "Set PSearchControl returnECs" )
            {
                public void action( PersistentSearchContainer container ) throws DecoderException
                {
                    Value value = container.getCurrentTLV().getValue();

                    try
                    {
                        boolean returnECs = BooleanDecoder.parse( value );

View Full Code Here

                UniversalTag.INTEGER.getValue(),
                new GrammarAction<GracefulShutdownContainer>( "Set Graceful Shutdown time offline" )
                {
                    public void action( GracefulShutdownContainer container ) throws DecoderException
                    {
                        Value value = container.getCurrentTLV().getValue();

                        try
                        {
                            int timeOffline = IntegerDecoder.parse( value, 0, 720 );

                            if ( IS_DEBUG )
                            {
                                LOG.debug( "Time Offline = " + timeOffline );
                            }

                            container.getGracefulShutdown().setTimeOffline( timeOffline );
                            container.setGrammarEndAllowed( true );
                        }
                        catch ( IntegerDecoderException e )
                        {
                            String msg = I18n.err( I18n.ERR_04037, Strings.dumpBytes( value.getData() ) );
                            LOG.error( msg );
                            throw new DecoderException( msg );
                        }
                    }
                } );

        /**
         * Transition from time offline to delay
         *
         * GracefulShutdown ::= SEQUENCE {
         *     ...
         *     delay [0] INTEGER (0..86400) DEFAULT 0 }
         *
         * Set the delay value into the GracefulShutdown
         * object.
         */
        super.transitions[GracefulShutdownStatesEnum.TIME_OFFLINE_STATE.ordinal()][GracefulActionConstants.GRACEFUL_ACTION_DELAY_TAG] =
            new GrammarTransition<GracefulShutdownContainer>( GracefulShutdownStatesEnum.TIME_OFFLINE_STATE,
                GracefulShutdownStatesEnum.DELAY_STATE,
                GracefulActionConstants.GRACEFUL_ACTION_DELAY_TAG,

                new GrammarAction<GracefulShutdownContainer>( "Set Graceful Shutdown Delay" )
                {
                    public void action( GracefulShutdownContainer container ) throws DecoderException
                    {
                        Value value = container.getCurrentTLV().getValue();

                        try
                        {
                            int delay = IntegerDecoder.parse( value, 0, 86400 );

                            if ( IS_DEBUG )
                            {
                                LOG.debug( "Delay = " + delay );
                            }

                            container.getGracefulShutdown().setDelay( delay );
                            container.setGrammarEndAllowed( true );
                        }
                        catch ( IntegerDecoderException e )
                        {
                            String msg = I18n.err( I18n.ERR_04036, Strings.dumpBytes( value.getData() ) );
                            LOG.error( msg );
                            throw new DecoderException( msg );
                        }
                    }
                } );

        /**
         * Transition from graceful shutdown to delay
         *
         * GracefulShutdown ::= SEQUENCE {
         *     ...
         *     delay [0] INTEGER (0..86400) DEFAULT 0 }
         *
         * Set the delay value into the GracefulShutdown
         * object.
         */
        super.transitions[GracefulShutdownStatesEnum.GRACEFUL_SHUTDOWN_SEQUENCE_STATE.ordinal()][GracefulActionConstants.GRACEFUL_ACTION_DELAY_TAG] =
            new GrammarTransition<GracefulShutdownContainer>(
                GracefulShutdownStatesEnum.GRACEFUL_SHUTDOWN_SEQUENCE_STATE,
                GracefulShutdownStatesEnum.DELAY_STATE,
                GracefulActionConstants.GRACEFUL_ACTION_DELAY_TAG,

                new GrammarAction<GracefulShutdownContainer>( "Set Graceful Shutdown Delay" )
                {
                    public void action( GracefulShutdownContainer container ) throws DecoderException
                    {
                        GracefulShutdownContainer gracefulShutdownContainer = ( GracefulShutdownContainer ) container;
                        Value value = gracefulShutdownContainer.getCurrentTLV().getValue();

                        try
                        {
                            int delay = IntegerDecoder.parse( value, 0, 86400 );

                            if ( IS_DEBUG )
                            {
                                LOG.debug( "Delay = " + delay );
                            }

                            gracefulShutdownContainer.getGracefulShutdown().setDelay( delay );
                            gracefulShutdownContainer.setGrammarEndAllowed( true );
                        }
                        catch ( IntegerDecoderException e )
                        {
                            String msg = I18n.err( I18n.ERR_04036, Strings.dumpBytes( value.getData() ) );
                            LOG.error( msg );
                            throw new DecoderException( msg );
                        }
                    }
                } );
View Full Code Here

               
                if ( type.equals( "int" ) )
                {
                    try
                    {
                        return IntegerDecoder.parse( new Value( (byte[]) obj ) );
                    }
                    catch ( IntegerDecoderException e )
                    {
                        throw new RuntimeException( "Failed to decode INTEGER: " +
                            Strings.dumpBytes( ( byte[] ) obj ), e );
View Full Code Here

        assertEquals( "execute", storedProcedure.getProcedureSpecification() );

        assertEquals( 3, storedProcedure.size() );

        assertEquals( "int", Strings.utf8ToString( ( byte[] ) storedProcedure.getParameterType( 0 ) ) );
        assertEquals( 1, IntegerDecoder.parse( new Value( ( byte[] ) storedProcedure.getParameterValue( 0 ) ) ) );

        assertEquals( "boolean", Strings.utf8ToString( ( byte[] ) storedProcedure.getParameterType( 1 ) ) );
        assertEquals( "true", Strings.utf8ToString( ( byte[] ) storedProcedure.getParameterValue( 1 ) ) );

        assertEquals( "String", Strings.utf8ToString( ( byte[] ) storedProcedure.getParameterType( 2 ) ) );
View Full Code Here

        assertEquals( "execute", storedProcedure.getProcedureSpecification() );

        assertEquals( 1, storedProcedure.size() );

        assertEquals( "int", Strings.utf8ToString( ( byte[] ) storedProcedure.getParameterType( 0 ) ) );
        assertEquals( 1, IntegerDecoder.parse( new Value( ( byte [] ) storedProcedure.getParameterValue( 0 ) ) ) );

        // Check the encoding
        try
        {
            ByteBuffer bb = storedProcedure.encode();
View Full Code Here

                UniversalTag.ENUMERATED.getValue(),
                new GrammarAction<SyncRequestValueContainer>( "Set SyncRequestValueControl mode" )
            {
                public void action( SyncRequestValueContainer container ) throws DecoderException
                {
                    Value value = container.getCurrentTLV().getValue();

                    try
                    {
                        // Check that the value is into the allowed interval
                        int mode = IntegerDecoder.parse( value,
                            SynchronizationModeEnum.UNUSED.getValue(),
                            SynchronizationModeEnum.REFRESH_AND_PERSIST.getValue() );
                       
                        SynchronizationModeEnum modeEnum = SynchronizationModeEnum.getSyncMode( mode );
                       
                        if ( IS_DEBUG )
                        {
                            LOG.debug( "Mode = " + modeEnum );
                        }

                        container.getSyncRequestValueControl().setMode( modeEnum );

                        // We can have an END transition
                        container.setGrammarEndAllowed( true );
                    }
                    catch ( IntegerDecoderException e )
                    {
                        String msg = I18n.err( I18n.ERR_04028 );
                        LOG.error( msg, e );
                        throw new DecoderException( msg );
                    }
                }
            } );


        /**
         * Transition from mode to cookie
         * SyncRequestValue ::= SEQUENCE OF {
         *     ...
         *     cookie     syncCookie OPTIONAL,
         *     ...
         *    
         * Stores the cookie
         */
        super.transitions[SyncRequestValueStatesEnum.MODE_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] =
            new GrammarTransition( SyncRequestValueStatesEnum.MODE_STATE,
                                    SyncRequestValueStatesEnum.COOKIE_STATE, UniversalTag.OCTET_STRING.getValue(),
                new GrammarAction<SyncRequestValueContainer>( "Set SyncRequestValueControl cookie" )
            {
                public void action( SyncRequestValueContainer container ) throws DecoderException
                {
                    Value value = container.getCurrentTLV().getValue();

                    byte[] cookie = value.getData();

                    if ( IS_DEBUG )
                    {
                        LOG.debug( "cookie = " + Strings.dumpBytes(cookie) );
                    }

                    container.getSyncRequestValueControl().setCookie( cookie );

                    // We can have an END transition
                    container.setGrammarEndAllowed( true );
                }
            } );


        /**
         * Transition from mode to reloadHint
         * SyncRequestValue ::= SEQUENCE OF {
         *     ...
         *     reloadHint BOOLEAN DEFAULT FALSE
         * }
         *    
         * Stores the reloadHint flag
         */
        super.transitions[SyncRequestValueStatesEnum.MODE_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] =
            new GrammarTransition( SyncRequestValueStatesEnum.MODE_STATE,
                                    SyncRequestValueStatesEnum.RELOAD_HINT_STATE, UniversalTag.BOOLEAN.getValue(),
                new GrammarAction<SyncRequestValueContainer>( "Set SyncRequestValueControl reloadHint flag" )
            {
                public void action( SyncRequestValueContainer container ) throws DecoderException
                {
                    Value value = container.getCurrentTLV().getValue();

                    try
                    {
                        boolean reloadHint = BooleanDecoder.parse(value);

                        if ( IS_DEBUG )
                        {
                            LOG.debug( "reloadHint = " + reloadHint );
                        }

                        container.getSyncRequestValueControl().setReloadHint( reloadHint );

                        // We can have an END transition
                        container.setGrammarEndAllowed( true );
                    }
                    catch ( BooleanDecoderException e )
                    {
                        String msg = I18n.err( I18n.ERR_04029 );
                        LOG.error( msg, e );
                        throw new DecoderException( msg );
                    }
                }
            } );


        /**
         * Transition from cookie to reloadHint
         * SyncRequestValue ::= SEQUENCE OF {
         *     ...
         *     reloadHint BOOLEAN DEFAULT FALSE
         * }
         *    
         * Stores the reloadHint flag
         */
        super.transitions[SyncRequestValueStatesEnum.COOKIE_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] =
            new GrammarTransition( SyncRequestValueStatesEnum.COOKIE_STATE,
                                    SyncRequestValueStatesEnum.RELOAD_HINT_STATE, UniversalTag.BOOLEAN.getValue(),
                new GrammarAction<SyncRequestValueContainer>( "Set SyncRequestValueControl reloadHint flag" )
            {
                public void action( SyncRequestValueContainer container ) throws DecoderException
                {
                    Value value = container.getCurrentTLV().getValue();

                    try
                    {
                        boolean reloadHint = BooleanDecoder.parse( value );

View Full Code Here

            {
                public void action( SyncInfoValueContainer container )
                {
                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();

                    Value value = container.getCurrentTLV().getValue();

                    byte[] newCookie = value.getData();

                    if ( IS_DEBUG )
                    {
                        LOG.debug( "newcookie = " + Strings.dumpBytes(newCookie) );
                    }

                    control.setCookie( newCookie );

                    // We can have an END transition
                    container.setGrammarEndAllowed( true );
                   
                    container.setSyncInfoValueControl( control );
                }
            } );


        /**
         * Transition from initial state to SyncInfoValue refreshDelete choice
         * SyncInfoValue ::= CHOICE {
         *     ...
         *     refreshDelete [1] SEQUENCE {
         *     ...
         *    
         * Initialize the syncInfoValue object
         */
        super.transitions[SyncInfoValueStatesEnum.START_STATE.ordinal()][SyncInfoValueTags.REFRESH_DELETE_TAG.getValue()] =
            new GrammarTransition( SyncInfoValueStatesEnum.START_STATE,
                                    SyncInfoValueStatesEnum.REFRESH_DELETE_STATE,
                                    SyncInfoValueTags.REFRESH_DELETE_TAG.getValue(),
                new GrammarAction<SyncInfoValueContainer>( "RefreshDelete choice for SyncInfoValueControl" )
            {
                public void action( SyncInfoValueContainer container )
                {
                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
                   
                    container.setSyncInfoValueControl( control );

                    // We can have an END transition
                    container.setGrammarEndAllowed( true );
                }
            } );


        /**
         * Transition from refreshDelete state to cookie
         *     refreshDelete [1] SEQUENCE {
         *         cookie syncCookie OPTIONAL,
         *     ...
         *    
         * Load the cookie object
         */
        super.transitions[SyncInfoValueStatesEnum.REFRESH_DELETE_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] =
            new GrammarTransition( SyncInfoValueStatesEnum.REFRESH_DELETE_STATE,
                                    SyncInfoValueStatesEnum.REFRESH_DELETE_COOKIE_STATE,
                                    UniversalTag.OCTET_STRING.getValue(),
                new GrammarAction<SyncInfoValueContainer>( "RefreshDelete cookie" )
            {
                public void action( SyncInfoValueContainer container )
                {
                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
                   
                    Value value = container.getCurrentTLV().getValue();

                    byte[] cookie = value.getData();

                    if ( IS_DEBUG )
                    {
                        LOG.debug( "cookie = " + Strings.dumpBytes(cookie) );
                    }

                    container.getSyncInfoValueControl().setCookie( cookie );
                    container.setSyncInfoValueControl( control );

                    // We can have an END transition
                    container.setGrammarEndAllowed( true );
                }
            } );


        /**
         * Transition from refreshDelete cookie state to refreshDone
         *     refreshDelete [1] SEQUENCE {
         *         ....
         *         refreshDone BOOLEAN DEFAULT TRUE
         *     }
         *    
         * Load the refreshDone flag
         */
        super.transitions[SyncInfoValueStatesEnum.REFRESH_DELETE_COOKIE_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] =
            new GrammarTransition( SyncInfoValueStatesEnum.REFRESH_DELETE_COOKIE_STATE,
                                    SyncInfoValueStatesEnum.LAST_SYNC_INFO_VALUE_STATE,
                                    UniversalTag.BOOLEAN.getValue(),
                new GrammarAction<SyncInfoValueContainer>( "RefreshDelete refreshDone flag" )
            {
                public void action( SyncInfoValueContainer container ) throws DecoderException
                {
                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
                   
                    Value value = container.getCurrentTLV().getValue();

                    try
                    {
                        boolean refreshDone = BooleanDecoder.parse( value );

                        if ( IS_DEBUG )
                        {
                            LOG.debug( "refreshDone = {}", refreshDone );
                        }

                        control.setRefreshDone( refreshDone );

                        container.setSyncInfoValueControl( control );

                        // the END transition for grammar
                        container.setGrammarEndAllowed( true );
                    }
                    catch ( BooleanDecoderException be )
                    {
                        String msg = I18n.err( I18n.ERR_04025 );
                        LOG.error( msg, be );
                        throw new DecoderException( msg );
                    }


                    // We can have an END transition
                    container.setGrammarEndAllowed( true );
                }
            } );


        /**
         * Transition from refreshDelete choice state to refreshDone
         *     refreshDelete [1] SEQUENCE {
         *         ....
         *         refreshDone BOOLEAN DEFAULT TRUE
         *     }
         *    
         * Load the refreshDone flag
         */
        super.transitions[SyncInfoValueStatesEnum.REFRESH_DELETE_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] =
            new GrammarTransition( SyncInfoValueStatesEnum.REFRESH_DELETE_STATE,
                                    SyncInfoValueStatesEnum.LAST_SYNC_INFO_VALUE_STATE,
                                    UniversalTag.BOOLEAN.getValue(),
                new GrammarAction<SyncInfoValueContainer>( "RefreshDelete refreshDone flag" )
            {
                public void action( SyncInfoValueContainer container ) throws DecoderException
                {
                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
                   
                    Value value = container.getCurrentTLV().getValue();

                    try
                    {
                        boolean refreshDone = BooleanDecoder.parse( value );

                        if ( IS_DEBUG )
                        {
                            LOG.debug( "refreshDone = {}", refreshDone );
                        }

                        control.setRefreshDone( refreshDone );

                        container.setSyncInfoValueControl( control );

                        // the END transition for grammar
                        container.setGrammarEndAllowed( true );
                    }
                    catch ( BooleanDecoderException be )
                    {
                        String msg = I18n.err( I18n.ERR_04025 );
                        LOG.error( msg, be );
                        throw new DecoderException( msg );
                    }


                    // We can have an END transition
                    container.setGrammarEndAllowed( true );
                }
            } );
       
       
        /**
         * Transition from initial state to SyncInfoValue refreshPresent choice
         * SyncInfoValue ::= CHOICE {
         *     ...
         *     refreshPresent [2] SEQUENCE {
         *     ...
         *    
         * Initialize the syncInfoValue object
         */
        super.transitions[SyncInfoValueStatesEnum.START_STATE.ordinal()][SyncInfoValueTags.REFRESH_PRESENT_TAG.getValue()] =
            new GrammarTransition( SyncInfoValueStatesEnum.START_STATE,
                                    SyncInfoValueStatesEnum.REFRESH_PRESENT_STATE,
                                    SyncInfoValueTags.REFRESH_PRESENT_TAG.getValue(),
                new GrammarAction<SyncInfoValueContainer>( "RefreshDelete choice for SyncInfoValueControl" )
            {
                public void action( SyncInfoValueContainer container )
                {
                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
                   
                    container.setSyncInfoValueControl( control );

                    // We can have an END transition
                    container.setGrammarEndAllowed( true );
                }
            } );

   
        /**
         * Transition from refreshPresent state to cookie
         *     refreshPresent [2] SEQUENCE {
         *         cookie syncCookie OPTIONAL,
         *     ...
         *    
         * Load the cookie object
         */
        super.transitions[SyncInfoValueStatesEnum.REFRESH_PRESENT_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] =
            new GrammarTransition( SyncInfoValueStatesEnum.REFRESH_PRESENT_STATE,
                                    SyncInfoValueStatesEnum.REFRESH_PRESENT_COOKIE_STATE,
                                    UniversalTag.OCTET_STRING.getValue(),
                new GrammarAction<SyncInfoValueContainer>( "RefreshPresent cookie" )
            {
                public void action( SyncInfoValueContainer container )
                {
                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
                   
                    Value value = container.getCurrentTLV().getValue();

                    byte[] cookie = value.getData();

                    if ( IS_DEBUG )
                    {
                        LOG.debug( "cookie = " + Strings.dumpBytes(cookie) );
                    }

                    container.getSyncInfoValueControl().setCookie( cookie );
                    container.setSyncInfoValueControl( control );

                    // We can have an END transition
                    container.setGrammarEndAllowed( true );
                }
            } );
       
       


        /**
         * Transition from refreshPresent cookie state to refreshDone
         *     refreshPresent [2] SEQUENCE {
         *         ....
         *         refreshDone BOOLEAN DEFAULT TRUE
         *     }
         *    
         * Load the refreshDone flag
         */
        super.transitions[SyncInfoValueStatesEnum.REFRESH_PRESENT_COOKIE_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] =
            new GrammarTransition( SyncInfoValueStatesEnum.REFRESH_PRESENT_COOKIE_STATE,
                                    SyncInfoValueStatesEnum.LAST_SYNC_INFO_VALUE_STATE,
                                    UniversalTag.BOOLEAN.getValue(),
                new GrammarAction<SyncInfoValueContainer>( "RefreshPresent refreshDone flag" )
            {
                public void action( SyncInfoValueContainer container ) throws DecoderException
                {
                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
                   
                    Value value = container.getCurrentTLV().getValue();

                    try
                    {
                        boolean refreshDone = BooleanDecoder.parse( value );

                        if ( IS_DEBUG )
                        {
                            LOG.debug( "refreshDone = {}", refreshDone );
                        }

                        control.setRefreshDone( refreshDone );

                        container.setSyncInfoValueControl( control );

                        // the END transition for grammar
                        container.setGrammarEndAllowed( true );
                    }
                    catch ( BooleanDecoderException be )
                    {
                        String msg = I18n.err( I18n.ERR_04025 );
                        LOG.error( msg, be );
                        throw new DecoderException( msg );
                    }


                    // We can have an END transition
                    container.setGrammarEndAllowed( true );
                }
            } );


        /**
         * Transition from refreshPresent choice state to refreshDone
         *     refreshPresent [1] SEQUENCE {
         *         ....
         *         refreshDone BOOLEAN DEFAULT TRUE
         *     }
         *    
         * Load the refreshDone flag
         */
        super.transitions[SyncInfoValueStatesEnum.REFRESH_PRESENT_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] =
            new GrammarTransition( SyncInfoValueStatesEnum.REFRESH_PRESENT_STATE,
                                    SyncInfoValueStatesEnum.LAST_SYNC_INFO_VALUE_STATE,
                                    UniversalTag.BOOLEAN.getValue(),
                new GrammarAction<SyncInfoValueContainer>( "RefreshPresent refreshDone flag" )
            {
                public void action( SyncInfoValueContainer container ) throws DecoderException
                {
                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
                   
                    Value value = container.getCurrentTLV().getValue();

                    try
                    {
                        boolean refreshDone = BooleanDecoder.parse( value );

                        if ( IS_DEBUG )
                        {
                            LOG.debug( "refreshDone = {}", refreshDone );
                        }

                        control.setRefreshDone( refreshDone );

                        container.setSyncInfoValueControl( control );

                        // the END transition for grammar
                        container.setGrammarEndAllowed( true );
                    }
                    catch ( BooleanDecoderException be )
                    {
                        String msg = I18n.err( I18n.ERR_04025 );
                        LOG.error( msg, be );
                        throw new DecoderException( msg );
                    }

                    // We can have an END transition
                    container.setGrammarEndAllowed( true );
                }
            } );
       
       
        /**
         * Transition from initial state to SyncInfoValue syncIdSet choice
         * SyncInfoValue ::= CHOICE {
         *     ...
         *     syncIdSet [3] SEQUENCE {
         *     ...
         *    
         * Initialize the syncInfoValue object
         */
        super.transitions[SyncInfoValueStatesEnum.START_STATE.ordinal()][SyncInfoValueTags.SYNC_ID_SET_TAG.getValue()] =
            new GrammarTransition( SyncInfoValueStatesEnum.START_STATE,
                                    SyncInfoValueStatesEnum.SYNC_ID_SET_STATE,
                                    SyncInfoValueTags.SYNC_ID_SET_TAG.getValue(),
                new GrammarAction<SyncInfoValueContainer>( "SyncIdSet choice for SyncInfoValueControl" )
            {
                public void action( SyncInfoValueContainer container )
                {
                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
                   
                    container.setSyncInfoValueControl( control );
                }
            } );
       
       
        /**
         * Transition from syncIdSet state to cookie
         *     syncIdSet [3] SEQUENCE {
         *         cookie syncCookie OPTIONAL,
         *     ...
         *    
         * Load the cookie object
         */
        super.transitions[SyncInfoValueStatesEnum.SYNC_ID_SET_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] =
            new GrammarTransition( SyncInfoValueStatesEnum.SYNC_ID_SET_STATE,
                                    SyncInfoValueStatesEnum.SYNC_ID_SET_COOKIE_STATE,
                                    UniversalTag.OCTET_STRING.getValue(),
                new GrammarAction<SyncInfoValueContainer>( "SyncIdSet cookie" )
            {
                public void action( SyncInfoValueContainer container )
                {
                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
                   
                    Value value = container.getCurrentTLV().getValue();

                    byte[] cookie = value.getData();

                    if ( IS_DEBUG )
                    {
                        LOG.debug( "cookie = " + Strings.dumpBytes(cookie) );
                    }

                    container.getSyncInfoValueControl().setCookie( cookie );
                    container.setSyncInfoValueControl( control );
                }
            } );
       
       
        /**
         * Transition from syncIdSet state to refreshDeletes
         *     syncIdSet [3] SEQUENCE {
         *         ...
         *         refreshDeletes BOOLEAN DEFAULT FALSE,
         *     ...
         *    
         * Load the refreshDeletes flag
         */
        super.transitions[SyncInfoValueStatesEnum.SYNC_ID_SET_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] =
            new GrammarTransition( SyncInfoValueStatesEnum.SYNC_ID_SET_STATE,
                                    SyncInfoValueStatesEnum.SYNC_ID_SET_REFRESH_DELETES_STATE,
                                    UniversalTag.BOOLEAN.getValue(),
                new GrammarAction<SyncInfoValueContainer>( "SyncIdSet refreshDeletes" )
            {
                public void action( SyncInfoValueContainer container ) throws DecoderException
                {
                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
                   
                    Value value = container.getCurrentTLV().getValue();

                    try
                    {
                        boolean refreshDeletes = BooleanDecoder.parse( value );

                        if ( IS_DEBUG )
                        {
                            LOG.debug( "refreshDeletes = {}", refreshDeletes );
                        }

                        control.setRefreshDeletes( refreshDeletes );

                        container.setSyncInfoValueControl( control );
                    }
                    catch ( BooleanDecoderException be )
                    {
                        String msg = I18n.err( I18n.ERR_04026 );
                        LOG.error( msg, be );
                        throw new DecoderException( msg );
                    }
                }
            } );
       
       
        /**
         * Transition from syncIdSet cookie state to refreshDeletes
         *     syncIdSet [3] SEQUENCE {
         *         ...
         *         refreshDeletes BOOLEAN DEFAULT FALSE,
         *     ...
         *    
         * Load the refreshDeletes flag
         */
        super.transitions[SyncInfoValueStatesEnum.SYNC_ID_SET_COOKIE_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] =
            new GrammarTransition( SyncInfoValueStatesEnum.SYNC_ID_SET_COOKIE_STATE,
                                    SyncInfoValueStatesEnum.SYNC_ID_SET_REFRESH_DELETES_STATE,
                                    UniversalTag.BOOLEAN.getValue(),
                new GrammarAction<SyncInfoValueContainer>( "SyncIdSet refreshDeletes" )
            {
                public void action( SyncInfoValueContainer container ) throws DecoderException
                {
                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
                   
                    Value value = container.getCurrentTLV().getValue();

                    try
                    {
                        boolean refreshDeletes = BooleanDecoder.parse( value );

                        if ( IS_DEBUG )
                        {
                            LOG.debug( "refreshDeletes = {}", refreshDeletes );
                        }

                        control.setRefreshDeletes( refreshDeletes );

                        container.setSyncInfoValueControl( control );
                    }
                    catch ( BooleanDecoderException be )
                    {
                        String msg = I18n.err( I18n.ERR_04024 );
                        LOG.error( msg, be );
                        throw new DecoderException( msg );
                    }
                }
            } );
       
       
        /**
         * Transition from syncIdSet state to syncUUIDs
         *     syncIdSet [3] SEQUENCE {
         *         ...
         *         syncUUIDs      *SET OF* syncUUID
         *     }
         *    
         * Initialize the UUID set : no action associated, except allowing a grammar end
         */
        super.transitions[SyncInfoValueStatesEnum.SYNC_ID_SET_STATE.ordinal()][UniversalTag.SET.getValue()] =
            new GrammarTransition( SyncInfoValueStatesEnum.SYNC_ID_SET_STATE,
                                    SyncInfoValueStatesEnum.SYNC_ID_SET_SET_OF_UUIDS_STATE,
                                    UniversalTag.SET.getValue(),
                new GrammarAction<SyncInfoValueContainer>( "SyncIdSet syncUUIDs" )
            {
                public void action( SyncInfoValueContainer container ) throws DecoderException
                {
                    // We can have an END transition
                    container.setGrammarEndAllowed( true );
                }
            } );
       
       
        /**
         * Transition from syncIdSet cookie state to syncUUIDs
         *     syncIdSet [3] SEQUENCE {
         *         ...
         *         syncUUIDs      *SET OF* syncUUID
         *     }
         *    
         * Initialize the UUID set : no action associated
         */
        super.transitions[SyncInfoValueStatesEnum.SYNC_ID_SET_COOKIE_STATE.ordinal()][UniversalTag.SET.getValue()] =
            new GrammarTransition( SyncInfoValueStatesEnum.SYNC_ID_SET_COOKIE_STATE,
                                    SyncInfoValueStatesEnum.SYNC_ID_SET_SET_OF_UUIDS_STATE,
                                    UniversalTag.SET.getValue(),
                new GrammarAction<SyncInfoValueContainer>( "SyncIdSet syncUUIDs" )
            {
                public void action( SyncInfoValueContainer container ) throws DecoderException
                {
                    // We can have an END transition
                    container.setGrammarEndAllowed( true );
                }
            } );
         
       
        /**
         * Transition from syncIdSet refreshDeletes state to syncUUIDs
         *     syncIdSet [3] SEQUENCE {
         *         ...
         *         syncUUIDs      *SET OF* syncUUID
         *     }
         *    
         * Initialize the UUID set : no action associated
         */
        super.transitions[SyncInfoValueStatesEnum.SYNC_ID_SET_REFRESH_DELETES_STATE.ordinal()][UniversalTag.SET.getValue()] =
            new GrammarTransition( SyncInfoValueStatesEnum.SYNC_ID_SET_REFRESH_DELETES_STATE,
                                    SyncInfoValueStatesEnum.SYNC_ID_SET_SET_OF_UUIDS_STATE,
                                    UniversalTag.SET.getValue(),
                new GrammarAction<SyncInfoValueContainer>( "SyncIdSet syncUUIDs" )
            {
                public void action( SyncInfoValueContainer container ) throws DecoderException
                {
                    // We can have an END transition
                    container.setGrammarEndAllowed( true );
                }
            } );
       
       
        /**
         * Transition from syncIdSet syncUUIDs to syncUUID
         *     syncIdSet [3] SEQUENCE {
         *         ...
         *         syncUUIDs      SET OF *syncUUID*
         *     }
         *    
         * Add the first UUID in the UUIDs list
         */
        super.transitions[SyncInfoValueStatesEnum.SYNC_ID_SET_SET_OF_UUIDS_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] =
            new GrammarTransition( SyncInfoValueStatesEnum.SYNC_ID_SET_SET_OF_UUIDS_STATE,
                                    SyncInfoValueStatesEnum.SYNC_ID_SET_UUID_STATE,
                                    UniversalTag.OCTET_STRING.getValue(),
                new GrammarAction<SyncInfoValueContainer>( "SyncIdSet first UUID" )
            {
                public void action( SyncInfoValueContainer container ) throws DecoderException
                {
                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
                   
                    Value value = container.getCurrentTLV().getValue();

                    byte[] uuid = value.getData();
                   
                    // UUID must be exactly 16 bytes long
                    if ( ( uuid == null ) || ( uuid.length != 16 ) )
                    {
                        String msg = I18n.err( I18n.ERR_04027 );
                        LOG.error( msg );
                        throw new DecoderException( msg );
                    }

                    if ( IS_DEBUG )
                    {
                        LOG.debug( "UUID = " + Strings.dumpBytes(uuid) );
                    }

                    // Store the UUID in the UUIDs list
                    control.addSyncUUID( uuid );
                   
                    // We can have an END transition
                    container.setGrammarEndAllowed( true );
                }
            } );
       
       
        /**
         * Transition from syncIdSet syncUUID to syncUUID
         *     syncIdSet [3] SEQUENCE {
         *         ...
         *         syncUUIDs      SET OF *syncUUID*
         *     }
         *    
         * Add a new UUID in the UUIDs list
         */
        super.transitions[SyncInfoValueStatesEnum.SYNC_ID_SET_UUID_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] =
            new GrammarTransition( SyncInfoValueStatesEnum.SYNC_ID_SET_UUID_STATE,
                                    SyncInfoValueStatesEnum.SYNC_ID_SET_UUID_STATE,
                                    UniversalTag.OCTET_STRING.getValue(),
                new GrammarAction<SyncInfoValueContainer>( "SyncIdSet UUID" )
            {
                public void action( SyncInfoValueContainer container ) throws DecoderException
                {
                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
                   
                    Value value = container.getCurrentTLV().getValue();

                    byte[] uuid = value.getData();
                   
                    // UUID must be exactly 16 bytes long
                    if ( ( uuid == null ) || ( uuid.length != 16 ) )
                    {
                        String msg = I18n.err( I18n.ERR_04027 );
View Full Code Here

            SyncStateValueStatesEnum.SYNC_TYPE_STATE, UniversalTag.ENUMERATED.getValue(),
            new GrammarAction<SyncStateValueContainer>( "Set SyncStateValueControl state type" )
            {
                public void action( SyncStateValueContainer container ) throws DecoderException
                {
                    Value value = container.getCurrentTLV().getValue();

                    try
                    {
                        // Check that the value is into the allowed interval
                        int syncStateType = IntegerDecoder.parse(value, SyncStateTypeEnum.PRESENT.getValue(),
                                SyncStateTypeEnum.MODDN.getValue());

                        SyncStateTypeEnum syncStateTypeEnum = SyncStateTypeEnum.getSyncStateType( syncStateType );

                        if ( IS_DEBUG )
                        {
                            LOG.debug( "SyncStateType = {}", syncStateTypeEnum );
                        }

                        container.getSyncStateValueControl().setSyncStateType( syncStateTypeEnum );

                        // move on to the entryUUID transition
                        container.setGrammarEndAllowed( false );
                    }
                    catch ( IntegerDecoderException e )
                    {
                        String msg = I18n.err( I18n.ERR_04030 );
                        LOG.error( msg, e );
                        throw new DecoderException( msg );
                    }
                }
            } );

        /**
         * Transition from sync state tpe to entryUUID
         * SyncStateValue ::= SEQUENCE OF {
         *     ...
         *     entryUUID     syncUUID
         *     ...
         *    
         * Stores the entryUUID
         */
        super.transitions[SyncStateValueStatesEnum.SYNC_TYPE_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = new GrammarTransition(
            SyncStateValueStatesEnum.SYNC_TYPE_STATE, SyncStateValueStatesEnum.SYNC_UUID_STATE,
            UniversalTag.OCTET_STRING.getValue(),
            new GrammarAction<SyncStateValueContainer>( "Set SyncStateValueControl entryUUID" )
            {
                public void action( SyncStateValueContainer container ) throws DecoderException
                {
                    Value value = container.getCurrentTLV().getValue();

                    byte[] entryUUID = value.getData();

                    if ( IS_DEBUG )
                    {
                        LOG.debug( "entryUUID = {}", Strings.dumpBytes(entryUUID) );
                    }

                    container.getSyncStateValueControl().setEntryUUID( entryUUID );

                    // We can have an END transition
                    container.setGrammarEndAllowed( true );
                }
            } );

        /**
         * Transition from entryUUID to cookie
         * SyncRequestValue ::= SEQUENCE OF {
         *     ...
         *     cookie    syncCookie OPTIONAL
         * }
         *    
         * Stores the reloadHint flag
         */
        super.transitions[SyncStateValueStatesEnum.SYNC_UUID_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = new GrammarTransition(
            SyncStateValueStatesEnum.SYNC_UUID_STATE, SyncStateValueStatesEnum.COOKIE_STATE,
            UniversalTag.OCTET_STRING.getValue(),
            new GrammarAction<SyncStateValueContainer>( "Set SyncStateValueControl cookie value" )
            {
                public void action( SyncStateValueContainer container ) throws DecoderException
                {
                    Value value = container.getCurrentTLV().getValue();

                    byte[] cookie = value.getData();

                    if ( IS_DEBUG )
                    {
                        LOG.debug( "cookie = {}", cookie );
                    }
View Full Code Here

            SyncModifyDnStatesEnum.ENTRY_DN_STATE, UniversalTag.OCTET_STRING.getValue(),
            new GrammarAction<SyncModifyDnContainer>( "Set SyncModifyDnControl entryDn value" )
            {
                public void action( SyncModifyDnContainer container ) throws DecoderException
                {
                    Value value = container.getCurrentTLV().getValue();

                    // Check that the value is into the allowed interval
                    String entryDn = Strings.utf8ToString(value.getData());
                   
                    if ( IS_DEBUG )
                    {
                        LOG.debug( "ModDN entryDn = {}", entryDn );
                    }
                   
                    container.getSyncModifyDnControl().setEntryDn( entryDn );
                   
                    // move on to the next transition
                    container.setGrammarEndAllowed( false );
                }
            } );

        /**
         * Transition to move choice
         * Operation ::= CHOICE {
         *     move-name       [0] LDAPDN
         *  }
         *    
         * Stores the newSuperiorDn value
         */

        super.transitions[SyncModifyDnStatesEnum.ENTRY_DN_STATE.ordinal()][SyncModifyDnTags.MOVE_TAG.getValue()] = new GrammarTransition(
            SyncModifyDnStatesEnum.ENTRY_DN_STATE, SyncModifyDnStatesEnum.MOVE_STATE,
            SyncModifyDnTags.MOVE_TAG.getValue(),
            new GrammarAction<SyncModifyDnContainer>( "Set SyncModifyDnControl newSuperiorDn" )
            {
                public void action( SyncModifyDnContainer container ) throws DecoderException
                {
                    container.getSyncModifyDnControl().setModDnType( SyncModifyDnType.MOVE );

                    // We need to read the move operation's superiorDN
                    Value value = container.getCurrentTLV().getValue();

                    // Check that the value is into the allowed interval
                    String newSuperiorDn = Strings.utf8ToString(value.getData());
                   
                    if ( IS_DEBUG )
                    {
                        LOG.debug( "ModDN newSuperiorDn = {}", newSuperiorDn );
                    }
                   
                    container.getSyncModifyDnControl().setNewSuperiorDn( newSuperiorDn );
                   
                    // move on to the next transition
                    container.setGrammarEndAllowed( true );
                }
            } );

       
        /**
         * read the newSuperiorDn
         * move-name       [0] LDAPDN
         */
        super.transitions[SyncModifyDnStatesEnum.ENTRY_DN_STATE.ordinal()][SyncModifyDnTags.RENAME_TAG.getValue()] = new GrammarTransition(
            SyncModifyDnStatesEnum.ENTRY_DN_STATE, SyncModifyDnStatesEnum.RENAME_STATE,
            SyncModifyDnTags.RENAME_TAG.getValue(),
            new GrammarAction<SyncModifyDnContainer>( "enter SyncModifyDnControl rename choice" )
            {
                public void action( SyncModifyDnContainer container ) throws DecoderException
                {
                    container.getSyncModifyDnControl().setModDnType( SyncModifyDnType.RENAME );
                    container.setGrammarEndAllowed( false );
                }
            } );

        /**
         * Transition from rename's RENAME state to newRdn
         *
         * Rename SEQUENCE {
         *     new-rdn Rdn,
         * }
         *           
         * Stores the newRdn value
         */
        super.transitions[SyncModifyDnStatesEnum.RENAME_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = new GrammarTransition(
            SyncModifyDnStatesEnum.RENAME_STATE, SyncModifyDnStatesEnum.RENAME_NEW_RDN_STATE,
            UniversalTag.OCTET_STRING.getValue(),
            new GrammarAction<SyncModifyDnContainer>( "Set SyncModifyDnControl newRdn value" )
            {
                public void action( SyncModifyDnContainer container ) throws DecoderException
                {
                    Value value = container.getCurrentTLV().getValue();

                    String newRdn = Strings.utf8ToString(value.getData());

                    if ( IS_DEBUG )
                    {
                        LOG.debug( "newRdn = {}", newRdn );
                    }

                    container.getSyncModifyDnControl().setNewRdn( newRdn );

                    // terminal state
                    container.setGrammarEndAllowed( false );
                }
            } );
      
       
        /**
         * Transition from rename's RENAME newRdn to deleteOldRdn
         *
         * Rename SEQUENCE {
         *   ....
         *   deleteOldRdn
         * }
         *           
         * Stores the deleteOldRdn value
         */
        super.transitions[SyncModifyDnStatesEnum.RENAME_NEW_RDN_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] = new GrammarTransition(
            SyncModifyDnStatesEnum.RENAME_NEW_RDN_STATE, SyncModifyDnStatesEnum.RENAME_DEL_OLD_RDN_STATE,
            UniversalTag.BOOLEAN.getValue(),
            new GrammarAction<SyncModifyDnContainer>( "Set SyncModifyDnControl deleteOldRdn value" )
            {
                public void action( SyncModifyDnContainer container ) throws DecoderException
                {
                    Value value = container.getCurrentTLV().getValue();

                    byte deleteOldRdn = value.getData()[0];

                    if ( IS_DEBUG )
                    {
                        LOG.debug( "deleteOldRdn = {}", deleteOldRdn );
                    }

                    if( deleteOldRdn != 0 )
                    {
                        container.getSyncModifyDnControl().setDeleteOldRdn( true );
                    }

                    // terminal state
                    container.setGrammarEndAllowed( true );
                }
            } );
       

        /**
         * Transition from entryDN to moveAndRename SEQUENCE
         *  MoveAndRename SEQUENCE {
         *    
         * Stores the deleteOldRdn flag
         */
        super.transitions[SyncModifyDnStatesEnum.ENTRY_DN_STATE.ordinal()][SyncModifyDnTags.MOVEANDRENAME_TAG.getValue()] = new GrammarTransition(
            SyncModifyDnStatesEnum.ENTRY_DN_STATE, SyncModifyDnStatesEnum.MOVE_AND_RENAME_STATE,
            SyncModifyDnTags.MOVEANDRENAME_TAG.getValue(),
            new GrammarAction<SyncModifyDnContainer>( "enter SyncModifyDnControl moveAndRename choice" )
            {
                public void action( SyncModifyDnContainer container ) throws DecoderException
                {
                    container.getSyncModifyDnControl().setModDnType( SyncModifyDnType.MOVE_AND_RENAME );
                    container.setGrammarEndAllowed( false );
                }
            } );

        /**
         * Transition from MOVE_AND_RENAME_STATE to newSuperiorDn
         *
         * MoveAndRename SEQUENCE {
         *      superior-name   LDAPDN
         *      ....
         *           
         * Stores the newRdn value
         */
        super.transitions[SyncModifyDnStatesEnum.MOVE_AND_RENAME_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = new GrammarTransition(
            SyncModifyDnStatesEnum.MOVE_AND_RENAME_STATE, SyncModifyDnStatesEnum.MOVE_AND_RENAME_NEW_SUPERIOR_DN_STATE,
            UniversalTag.OCTET_STRING.getValue(),
            new GrammarAction<SyncModifyDnContainer>( "Set SyncModifyDnControl moveAndRename state's newSuperirorDN value" )
            {
                public void action( SyncModifyDnContainer container ) throws DecoderException
                {
                    Value value = container.getCurrentTLV().getValue();

                    String newSuperirorDn = Strings.utf8ToString(value.getData());

                    if ( IS_DEBUG )
                    {
                        LOG.debug( "newSuperirorDn = {}", newSuperirorDn );
                    }

                    container.getSyncModifyDnControl().setNewSuperiorDn( newSuperirorDn );

                    // terminal state
                    container.setGrammarEndAllowed( false );
                }
            } );

        /**
         * Transition from moveAndRename's newSuperiorDn to newRdn
         *
         * MoveAndRename SEQUENCE {
         *      superior-name   LDAPDN
         *      ....
         *           
         * Stores the newRdn value
         */
        super.transitions[SyncModifyDnStatesEnum.MOVE_AND_RENAME_NEW_SUPERIOR_DN_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = new GrammarTransition(
            SyncModifyDnStatesEnum.MOVE_AND_RENAME_NEW_SUPERIOR_DN_STATE, SyncModifyDnStatesEnum.MOVE_AND_RENAME_NEW_RDN_STATE,
            UniversalTag.OCTET_STRING.getValue(),
            new GrammarAction<SyncModifyDnContainer>( "Set SyncModifyDnControl moveAndRename state's newRdn value" )
            {
                public void action( SyncModifyDnContainer container ) throws DecoderException
                {
                    Value value = container.getCurrentTLV().getValue();

                    String newRdn = Strings.utf8ToString(value.getData());

                    if ( IS_DEBUG )
                    {
                        LOG.debug( "newRdn = {}", newRdn );
                    }

                    container.getSyncModifyDnControl().setNewRdn( newRdn );

                    // terminal state
                    container.setGrammarEndAllowed( false );
                }
            } );
       

        /**
         * Transition from moveAndRename's newRdn to deleteOldRdn
         *  MoveAndRename SEQUENCE {
         *      ....
         *      delete-old-rdn BOOLEAN
         *    
         * Stores the deleteOldRdn flag
         */
        super.transitions[SyncModifyDnStatesEnum.MOVE_AND_RENAME_NEW_RDN_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] = new GrammarTransition(
            SyncModifyDnStatesEnum.MOVE_AND_RENAME_NEW_RDN_STATE, SyncModifyDnStatesEnum.MOVE_AND_RENAME_DEL_OLD_RDN_STATE,
            UniversalTag.BOOLEAN.getValue(),
            new GrammarAction<SyncModifyDnContainer>( "Set SyncModifyDnControl deleteOldRdn value" )
            {
                public void action( SyncModifyDnContainer container ) throws DecoderException
                {
                    Value value = container.getCurrentTLV().getValue();

                    byte deleteOldRdn = value.getData()[0];

                    if ( IS_DEBUG )
                    {
                        LOG.debug( "deleteOldRdn = {}", deleteOldRdn );
                    }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.asn1.ber.tlv.Value

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.