Package org.apache.directory.api.asn1.ber.grammar

Examples of org.apache.directory.api.asn1.ber.grammar.GrammarAction


    /**
     * {@inheritDoc}
     */
    public void action( TicketContainer ticketContainer ) throws DecoderException
    {
        TLV tlv = ticketContainer.getCurrentTLV();

        // The Length should not be null
        if ( tlv.getLength() == 0 )
        {
            LOG.error( I18n.err( I18n.ERR_744_NULL_PDU_LENGTH ) );

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( I18n.err( I18n.ERR_744_NULL_PDU_LENGTH ) );
View Full Code Here


         */
        super.transitions[CancelStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
            new GrammarTransition<CancelContainer>( CancelStatesEnum.START_STATE,
                CancelStatesEnum.CANCEL_SEQUENCE_STATE,
                UniversalTag.SEQUENCE.getValue(),
                new GrammarAction( "Init Cancel" )
                {
                    public void action( Asn1Container container )
                    {
                        CancelContainer cancelContainer = ( CancelContainer ) container;
                        Cancel cancel = new Cancel();
                        cancelContainer.setCancel( cancel );
                    }
                } );

        /**
         * Transition from cancel SEQ to cancelId
         *
         * cancelRequestValue ::= SEQUENCE {
         *     cancelId   MessageID
         * }
         *    
         * Set the cancelId value into the Cancel object.   
         */
        super.transitions[CancelStatesEnum.CANCEL_SEQUENCE_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
            new GrammarTransition<CancelContainer>( CancelStatesEnum.CANCEL_SEQUENCE_STATE,
                CancelStatesEnum.CANCEL_ID_STATE,
                UniversalTag.INTEGER.getValue(),
                new GrammarAction( "Stores CancelId" )
                {
                    public void action( Asn1Container container ) throws DecoderException
                    {
                        CancelContainer cancelContainer = ( CancelContainer ) container;
                        Value value = cancelContainer.getCurrentTLV().getValue();
View Full Code Here

         */
        super.transitions[CancelStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
            new GrammarTransition<CancelContainer>( CancelStatesEnum.START_STATE,
                                    CancelStatesEnum.CANCEL_SEQUENCE_STATE,
                                    UniversalTag.SEQUENCE.getValue(),
                new GrammarAction( "Init Cancel" )
            {
                public void action( Asn1Container container )
                {
                    CancelContainer cancelContainer = ( CancelContainer ) container;
                    Cancel cancel = new Cancel();
                    cancelContainer.setCancel( cancel );
                }
            } );

        /**
         * Transition from cancel SEQ to cancelId
         *
         * cancelRequestValue ::= SEQUENCE {
         *     cancelId   MessageID
         * }
         *    
         * Set the cancelId value into the Cancel object.   
         */
        super.transitions[CancelStatesEnum.CANCEL_SEQUENCE_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
            new GrammarTransition<CancelContainer>( CancelStatesEnum.CANCEL_SEQUENCE_STATE,
                                    CancelStatesEnum.CANCEL_ID_STATE,
                                    UniversalTag.INTEGER.getValue(),
                new GrammarAction( "Stores CancelId" )
            {
                public void action( Asn1Container container ) throws DecoderException
                {
                    CancelContainer cancelContainer = ( CancelContainer ) container;
                    Value value = cancelContainer.getCurrentTLV().getValue();
View Full Code Here

         */
        super.transitions[GracefulDisconnectStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
            new GrammarTransition( GracefulDisconnectStatesEnum.START_STATE,
                                    GracefulDisconnectStatesEnum.GRACEFUL_DISCONNECT_SEQUENCE_STATE,
                                    UniversalTag.SEQUENCE.getValue(),
                new GrammarAction(
                "Init Graceful Disconnect" )
            {
                public void action( Asn1Container container )
                {
                    GracefulDisconnectContainer gracefulDisconnectContainer = ( GracefulDisconnectContainer ) container;
View Full Code Here

         */
        super.transitions[GracefulShutdownStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
            new GrammarTransition( GracefulShutdownStatesEnum.START_STATE,
                GracefulShutdownStatesEnum.GRACEFUL_SHUTDOWN_SEQUENCE_STATE,
                UniversalTag.SEQUENCE.getValue(),
                new GrammarAction( "Init GracefulShutdown" )
            {
                public void action( Asn1Container container )
                {
                    GracefulShutdownContainer gracefulShutdownContainer = ( GracefulShutdownContainer ) container;
                    GracefulShutdown gracefulShutdown = new GracefulShutdown();
                    gracefulShutdownContainer.setGracefulShutdown( gracefulShutdown );
                    gracefulShutdownContainer.setGrammarEndAllowed( true );
                }
            } );

        /**
         * Transition from graceful shutdown to time offline
         *
         * GracefulShutdown ::= SEQUENCE {
         *     timeOffline INTEGER (0..720) DEFAULT 0,
         *     ...
         *    
         * Set the time offline value into the GracefulShutdown
         * object.
         */
        super.transitions[GracefulShutdownStatesEnum.GRACEFUL_SHUTDOWN_SEQUENCE_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
            new GrammarTransition( GracefulShutdownStatesEnum.GRACEFUL_SHUTDOWN_SEQUENCE_STATE,
                                    GracefulShutdownStatesEnum.TIME_OFFLINE_STATE,
                                    UniversalTag.INTEGER.getValue(),
                new GrammarAction( "Set Graceful Shutdown time offline" )
            {
                public void action( Asn1Container container ) throws DecoderException
                {
                    GracefulShutdownContainer gracefulShutdownContainer = ( GracefulShutdownContainer ) container;
                    Value value = gracefulShutdownContainer.getCurrentTLV().getValue();

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

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

                        gracefulShutdownContainer.getGracefulShutdown().setTimeOffline( timeOffline );
                        gracefulShutdownContainer.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( GracefulShutdownStatesEnum.TIME_OFFLINE_STATE,
                                    GracefulShutdownStatesEnum.DELAY_STATE,
                                    GracefulActionConstants.GRACEFUL_ACTION_DELAY_TAG,

                new GrammarAction( "Set Graceful Shutdown Delay" )
            {
                public void action( Asn1Container 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 );
                    }
                }
            } );
       
        /**
         * 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( GracefulShutdownStatesEnum.GRACEFUL_SHUTDOWN_SEQUENCE_STATE,
                                    GracefulShutdownStatesEnum.DELAY_STATE,
                                    GracefulActionConstants.GRACEFUL_ACTION_DELAY_TAG,

                new GrammarAction( "Set Graceful Shutdown Delay" )
            {
                public void action( Asn1Container container ) throws DecoderException
                {
                    GracefulShutdownContainer gracefulShutdownContainer = ( GracefulShutdownContainer ) container;
                    Value value = gracefulShutdownContainer.getCurrentTLV().getValue();
View Full Code Here

         *    
         * Creates the CertGenerationObject object
         */
        super.transitions[CertGenerationStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
            CertGenerationStatesEnum.START_STATE, CertGenerationStatesEnum.CERT_GENERATION_REQUEST_SEQUENCE_STATE,
            UniversalTag.SEQUENCE.getValue(), new GrammarAction( "Init CertGenerationObject" )
            {
                public void action( Asn1Container container )
                {
                    CertGenerationContainer certGenContainer = ( CertGenerationContainer ) container;
                    CertGenerationObject certGenerationObject = new CertGenerationObject();
                    certGenContainer.setCertGenerationObject( certGenerationObject );
                }
            } );

        /**
         * Transition from certificate generation request to targetDN
         *
         * CertGenerationObject ::= SEQUENCE {
         *     targetDN IA5String,
         *     ...
         *    
         * Set the targetDN value into the CertGenerationObject instance.
         */
        super.transitions[CertGenerationStatesEnum.CERT_GENERATION_REQUEST_SEQUENCE_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = new GrammarTransition(
            CertGenerationStatesEnum.CERT_GENERATION_REQUEST_SEQUENCE_STATE, CertGenerationStatesEnum.TARGETDN_STATE,
            UniversalTag.OCTET_STRING.getValue(), new GrammarAction( "Set Cert Generation target Dn value" )
            {
                public void action( Asn1Container container ) throws DecoderException
                {
                    CertGenerationContainer certGenContainer = ( CertGenerationContainer ) container;
                    Value value = certGenContainer.getCurrentTLV().getValue();

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

                    if ( IS_DEBUG )
                    {
                        LOG.debug( "Target Dn = " + targetDN );
                    }

                    if ( ( targetDN != null ) && ( targetDN.trim().length() > 0 ) )
                    {
                        if( !Dn.isValid(targetDN) )
                        {
                            String msg = I18n.err( I18n.ERR_04032, targetDN );
                            LOG.error( msg );
                            throw new DecoderException( msg );
                        }
                       
                        certGenContainer.getCertGenerationObject().setTargetDN( targetDN );
                    }
                    else
                    {
                        String msg = I18n.err( I18n.ERR_04033, Strings.dumpBytes(value.getData()) );
                        LOG.error( msg );
                        throw new DecoderException( msg );
                    }
                }
            } );

        /**
         * Transition from targetDN state to issuerDN
         *
         * CertGenerationObject ::= SEQUENCE {
         *     ...
         *     issuerDN IA5String,
         *     ...
         *    
         * Set the issuerDN value into the CertGenerationObject instance.
         */
        super.transitions[CertGenerationStatesEnum.TARGETDN_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = new GrammarTransition(
            CertGenerationStatesEnum.TARGETDN_STATE, CertGenerationStatesEnum.ISSUER_STATE, UniversalTag.OCTET_STRING.getValue(),
            new GrammarAction( "Set Cert Generation issuer Dn value" )
            {
                public void action( Asn1Container container ) throws DecoderException
                {
                    CertGenerationContainer certGenContainer = ( CertGenerationContainer ) container;
                    Value value = certGenContainer.getCurrentTLV().getValue();

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

                    if ( IS_DEBUG )
                    {
                        LOG.debug( "Issuer Dn = " + issuerDN );
                    }

                    if ( ( issuerDN != null ) && ( issuerDN.trim().length() > 0 ) )
                    {
                        if( !Dn.isValid(issuerDN) )
                        {
                            String msg = I18n.err( I18n.ERR_04034, issuerDN );
                            LOG.error( msg );
                            throw new DecoderException( msg );
                        }
                       
                        certGenContainer.getCertGenerationObject().setIssuerDN( issuerDN );
                    }
                }
            } );

        /**
         * Transition from issuerDN state to subjectDN
         *
         * CertGenerationObject ::= SEQUENCE {
         *     ...
         *     subjectDN IA5String,
         *     ...
         *    
         * Set the subjectDN value into the CertGenerationObject instance.
         */
        super.transitions[CertGenerationStatesEnum.ISSUER_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = new GrammarTransition(
            CertGenerationStatesEnum.ISSUER_STATE, CertGenerationStatesEnum.SUBJECT_STATE, UniversalTag.OCTET_STRING.getValue(),
            new GrammarAction( "Set Cert Generation subject Dn value" )
            {
                public void action( Asn1Container container ) throws DecoderException
                {
                    CertGenerationContainer certGenContainer = ( CertGenerationContainer ) container;
                    Value value = certGenContainer.getCurrentTLV().getValue();

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

                    if ( IS_DEBUG )
                    {
                        LOG.debug( "subject Dn = " + subjectDN );
                    }

                    if ( ( subjectDN != null ) && ( subjectDN.trim().length() > 0 ) )
                    {
                        if( !Dn.isValid(subjectDN) )
                        {
                            String msg = I18n.err( I18n.ERR_04035, subjectDN );
                            LOG.error( msg );
                            throw new DecoderException( msg );
                        }

                        certGenContainer.getCertGenerationObject().setSubjectDN( subjectDN );
                    }
                    else
                    {
                        String msg = I18n.err( I18n.ERR_04033, Strings.dumpBytes(value.getData()) );
                        LOG.error( msg );
                        throw new DecoderException( msg );
                    }
                }
            } );

        /**
         * Transition from subjectDN state to keyAlgo
         *
         * CertGenerationObject ::= SEQUENCE {
         *     ...
         *     keyAlgorithm IA5String
         *    
         * Set the key algorithm value into the CertGenerationObject instance.
         */
        super.transitions[CertGenerationStatesEnum.SUBJECT_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = new GrammarTransition(
            CertGenerationStatesEnum.SUBJECT_STATE, CertGenerationStatesEnum.KEY_ALGORITHM_STATE,
            UniversalTag.OCTET_STRING.getValue(), new GrammarAction( "Set Cert Generation key algorithm value" )
            {
                public void action( Asn1Container container ) throws DecoderException
                {
                    CertGenerationContainer certGenContainer = ( CertGenerationContainer ) container;
                    Value value = certGenContainer.getCurrentTLV().getValue();
View Full Code Here

        // Creates the storeProcedure and stores the language
        super.transitions[StoredProcedureStatesEnum.STORED_PROCEDURE_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] =
            new GrammarTransition( StoredProcedureStatesEnum.STORED_PROCEDURE_STATE,
                                    StoredProcedureStatesEnum.LANGUAGE_STATE,
                                    UniversalTag.OCTET_STRING.getValue(),
                new GrammarAction( "Stores the language" )
            {
                public void action( Asn1Container container ) throws DecoderException
                {

                    StoredProcedureContainer storedProcedureContainer = ( StoredProcedureContainer ) container;

                    TLV tlv = storedProcedureContainer.getCurrentTLV();

                    StoredProcedure storedProcedure = null;

                    // Store the value.
                    if ( tlv.getLength() == 0 )
                    {
                        // We can't have a void language !
                        String msg = I18n.err( I18n.ERR_04038 );
                        LOG.error( msg );
                        throw new DecoderException( msg );
                    }
                    else
                    {
                        // Only this field's type is String by default
                        String language = Strings.utf8ToString(tlv.getValue().getData());

                        if ( LOG.isDebugEnabled() )
                        {
                            LOG.debug( "SP language found: " + language );
                        }

                        storedProcedure = new StoredProcedure();
                        storedProcedure.setLanguage( language );
                        storedProcedureContainer.setStoredProcedure( storedProcedure );
                    }
                }
            } );

        //    procedure OCTETSTRING, (Value)
        //    ...
        // Stores the procedure.
        super.transitions[StoredProcedureStatesEnum.LANGUAGE_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] =
            new GrammarTransition( StoredProcedureStatesEnum.LANGUAGE_STATE,
                                    StoredProcedureStatesEnum.PROCEDURE_STATE,
                                    UniversalTag.OCTET_STRING.getValue(),
                new GrammarAction(
                "Stores the procedure" )
            {
                public void action( Asn1Container container ) throws DecoderException
                {

                    StoredProcedureContainer storedProcedureContainer = ( StoredProcedureContainer ) container;

                    TLV tlv = storedProcedureContainer.getCurrentTLV();

                    StoredProcedure storedProcedure = storedProcedureContainer.getStoredProcedure();

                    // Store the value.
                    if ( tlv.getLength() == 0 )
                    {
                        // We can't have a void procedure !
                        String msg = I18n.err( I18n.ERR_04039 );
                        LOG.error( msg );
                        throw new DecoderException( msg );
                    }
                    else
                    {
                        byte[] procedure = tlv.getValue().getData();

                        storedProcedure.setProcedure( procedure );
                    }

                    if ( LOG.isDebugEnabled() )
                    {
                        LOG.debug( "Procedure found : " + Strings.utf8ToString(storedProcedure.getProcedure()) );
                    }
                }
            } );

        // parameters SEQUENCE OF Parameter { (Value)
        //    ...
        // The list of parameters will be created with the first parameter.
        // We can have an empty list of parameters, so the PDU can be empty
        super.transitions[StoredProcedureStatesEnum.PROCEDURE_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
            new GrammarTransition( StoredProcedureStatesEnum.PROCEDURE_STATE,
                                    StoredProcedureStatesEnum.PARAMETERS_STATE,
                                    UniversalTag.SEQUENCE.getValue(),
            new GrammarAction(
                "Stores the parameters" )
            {
                public void action( Asn1Container container ) throws DecoderException
                {
                    StoredProcedureContainer storedProcedureContainer = ( StoredProcedureContainer ) container;
                    storedProcedureContainer.setGrammarEndAllowed( true );
                }
            } );
       
        // parameter SEQUENCE OF { (Value)
        //    ...
        // Nothing to do.
        super.transitions[StoredProcedureStatesEnum.PARAMETERS_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
            new GrammarTransition( StoredProcedureStatesEnum.PARAMETERS_STATE,
                                    StoredProcedureStatesEnum.PARAMETER_STATE,
                                    UniversalTag.SEQUENCE.getValue(),
                                    null );

        // Parameter ::= {
        //    type OCTETSTRING, (Value)
        //    ...
        //
        // We can create a parameter, and store its type
        super.transitions[StoredProcedureStatesEnum.PARAMETER_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] =
            new GrammarTransition( StoredProcedureStatesEnum.PARAMETER_STATE,
                                    StoredProcedureStatesEnum.PARAMETER_TYPE_STATE,
                                    UniversalTag.OCTET_STRING.getValue(),
                new GrammarAction( "Store parameter type" )
            {
                public void action( Asn1Container container ) throws DecoderException
                {
                    StoredProcedureContainer storedProcedureContainer = ( StoredProcedureContainer ) container;

                    TLV tlv = storedProcedureContainer.getCurrentTLV();
                    StoredProcedure storedProcedure = storedProcedureContainer.getStoredProcedure();

                    // Store the value.
                    if ( tlv.getLength() == 0 )
                    {
                        // We can't have a void parameter type !
                        String msg = I18n.err( I18n.ERR_04040 );
                        LOG.error( msg );
                        throw new DecoderException( msg );
                    }
                    else
                    {
                        StoredProcedureParameter parameter = new StoredProcedureParameter();

                        byte[] parameterType = tlv.getValue().getData();

                        parameter.setType( parameterType );

                        // We store the type in the current parameter.
                        storedProcedure.setCurrentParameter( parameter );

                        if ( LOG.isDebugEnabled() )
                        {
                            LOG.debug( "Parameter type found : " + Strings.dumpBytes(parameterType) );
                        }

                    }
                }
            } );

        // Parameter ::= {
        //    ...
        //    value OCTETSTRING (Tag)
        // }
        // Store the parameter value
        super.transitions[StoredProcedureStatesEnum.PARAMETER_TYPE_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] =
            new GrammarTransition( StoredProcedureStatesEnum.PARAMETER_TYPE_STATE,
                                    StoredProcedureStatesEnum.PARAMETER_VALUE_STATE,
                                    UniversalTag.OCTET_STRING.getValue(),
                new GrammarAction( "Store parameter value" )
            {
                public void action( Asn1Container container ) throws DecoderException
                {
                    StoredProcedureContainer storedProcedureContainer = ( StoredProcedureContainer ) container;
View Full Code Here

         */
        super.transitions[CancelStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
            new GrammarTransition( CancelStatesEnum.START_STATE,
                                    CancelStatesEnum.CANCEL_SEQUENCE_STATE,
                                    UniversalTag.SEQUENCE.getValue(),
                new GrammarAction(
                "Init Cancel" )
            {
                public void action( Asn1Container container )
                {
                    CancelContainer cancelContainer = ( CancelContainer ) container;
                    Cancel cancel = new Cancel();
                    cancelContainer.setCancel( cancel );
                }
            } );

        /**
         * Transition from cancel SEQ to cancelId
         *
         * cancelRequestValue ::= SEQUENCE {
         *     cancelId   MessageID
         * }
         *    
         * Set the cancelId value into the Cancel object.   
         */
        super.transitions[CancelStatesEnum.CANCEL_SEQUENCE_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
            new GrammarTransition( CancelStatesEnum.CANCEL_SEQUENCE_STATE,
                                    CancelStatesEnum.CANCEL_ID_STATE,
                                    UniversalTag.INTEGER.getValue(),
                new GrammarAction( "Stores CancelId" )
            {
                public void action( Asn1Container container ) throws DecoderException
                {
                    CancelContainer cancelContainer = ( CancelContainer ) container;
                    Value value = cancelContainer.getCurrentTLV().getValue();
View Full Code Here

         */
        super.transitions[CancelStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
            new GrammarTransition<CancelContainer>( CancelStatesEnum.START_STATE,
                                    CancelStatesEnum.CANCEL_SEQUENCE_STATE,
                                    UniversalTag.SEQUENCE.getValue(),
                new GrammarAction( "Init Cancel" )
            {
                public void action( Asn1Container container )
                {
                    CancelContainer cancelContainer = ( CancelContainer ) container;
                    Cancel cancel = new Cancel();
                    cancelContainer.setCancel( cancel );
                }
            } );

        /**
         * Transition from cancel SEQ to cancelId
         *
         * cancelRequestValue ::= SEQUENCE {
         *     cancelId   MessageID
         * }
         *    
         * Set the cancelId value into the Cancel object.   
         */
        super.transitions[CancelStatesEnum.CANCEL_SEQUENCE_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
            new GrammarTransition<CancelContainer>( CancelStatesEnum.CANCEL_SEQUENCE_STATE,
                                    CancelStatesEnum.CANCEL_ID_STATE,
                                    UniversalTag.INTEGER.getValue(),
                new GrammarAction( "Stores CancelId" )
            {
                public void action( Asn1Container container ) throws DecoderException
                {
                    CancelContainer cancelContainer = ( CancelContainer ) container;
                    Value value = cancelContainer.getCurrentTLV().getValue();
View Full Code Here

         */
        super.transitions[CancelStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
            new GrammarTransition<CancelContainer>( CancelStatesEnum.START_STATE,
                CancelStatesEnum.CANCEL_SEQUENCE_STATE,
                UniversalTag.SEQUENCE.getValue(),
                new GrammarAction( "Init Cancel" )
                {
                    public void action( Asn1Container container )
                    {
                        CancelContainer cancelContainer = ( CancelContainer ) container;
                        Cancel cancel = new Cancel();
                        cancelContainer.setCancel( cancel );
                    }
                } );

        /**
         * Transition from cancel SEQ to cancelId
         *
         * cancelRequestValue ::= SEQUENCE {
         *     cancelId   MessageID
         * }
         *    
         * Set the cancelId value into the Cancel object.   
         */
        super.transitions[CancelStatesEnum.CANCEL_SEQUENCE_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
            new GrammarTransition<CancelContainer>( CancelStatesEnum.CANCEL_SEQUENCE_STATE,
                CancelStatesEnum.CANCEL_ID_STATE,
                UniversalTag.INTEGER.getValue(),
                new GrammarAction( "Stores CancelId" )
                {
                    public void action( Asn1Container container ) throws DecoderException
                    {
                        CancelContainer cancelContainer = ( CancelContainer ) container;
                        BerValue value = cancelContainer.getCurrentTLV().getValue();
View Full Code Here

TOP

Related Classes of org.apache.directory.api.asn1.ber.grammar.GrammarAction

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.