Package org.apache.directory.shared.asn1

Examples of org.apache.directory.shared.asn1.DecoderException


        if ( tlv.getLength() == 0 )
        {
            String msg = I18n.err( I18n.ERR_04022 );
            LOG.error( msg );
            throw new DecoderException( msg );
        }
        else
        {
            // Store the value.
            ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) searchRequest.getTerminalFilter();
View Full Code Here


                    }
                    catch ( IntegerDecoderException e )
                    {
                        String msg = I18n.err( I18n.ERR_04050 );
                        LOG.error( msg, e );
                        throw new DecoderException( msg );
                    }
                }
            } );

        /**
 
View Full Code Here

                        // This is for the client side. We will never decode LdapResult on the server
                        String msg = I18n.err( I18n.ERR_04013, dnStr, Strings.dumpBytes(dnBytes), ine
                            .getLocalizedMessage() );
                        LOG.error( msg );

                        throw new DecoderException( I18n.err( I18n.ERR_04014, ine.getLocalizedMessage() ) );
                    }

                    break;

                default:
View Full Code Here

                            break;

                        default:
                            String msg = I18n.err( I18n.ERR_04044 );
                            LOG.error( msg );
                            throw new DecoderException( msg );
                    }

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

        // ============================================================================================
        // Transition from Change Type to Previous Dn
        // ============================================================================================
        // EntryChangeNotification ::= SEQUENCE {
        //     ...
        //     previousDN LDAPDN OPTIONAL,
        //     ...
        //
        // Set the previousDN into the structure. We first check that it's a
        // valid Dn
        super.transitions[ EntryChangeStates.CHANGE_TYPE_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] =
            new GrammarTransition( EntryChangeStates.CHANGE_TYPE_STATE,
                                    EntryChangeStates.PREVIOUS_DN_STATE,
                                    UniversalTag.OCTET_STRING.getValue(),
            new GrammarAction<EntryChangeContainer>( "Set EntryChangeControl previousDN" )
        {
            public void action( EntryChangeContainer container ) throws DecoderException
            {
                ChangeType changeType = container.getEntryChangeDecorator().getChangeType();


                if ( changeType != ChangeType.MODDN )
                {
                    LOG.error( I18n.err( I18n.ERR_04045 ) );
                    throw new DecoderException( I18n.err( I18n.ERR_04046 ));
                }
                else
                {
                    Value value = container.getCurrentTLV().getValue();
                    Dn previousDn;

                    try
                    {
                        previousDn = new Dn( Strings.utf8ToString(value.getData()) );
                    }
                    catch ( LdapInvalidDnException ine )
                    {
                        LOG.error( I18n.err( I18n.ERR_04047, Strings.dumpBytes(value.getData()) ) );
                        throw new DecoderException( I18n.err( I18n.ERR_04048 ) );
                    }

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

                    container.getEntryChangeDecorator().setPreviousDn( previousDn );

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

        // Change Number action
        GrammarAction<EntryChangeContainer> setChangeNumberAction = new GrammarAction<EntryChangeContainer>( "Set EntryChangeControl changeNumber" )
        {
            public void action( EntryChangeContainer container ) throws DecoderException
            {
                Value value = container.getCurrentTLV().getValue();

                try
                {
                    long changeNumber = LongDecoder.parse( value );

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

                    container.getEntryChangeDecorator().setChangeNumber( changeNumber );

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

        // ============================================================================================
View Full Code Here

        }
        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 !
        switch ( resultCode )
        {
View Full Code Here

        if ( expectedLength == 0 )
        {
            String msg = I18n.err( I18n.ERR_04012 );
            LOG.error( msg );
            throw new DecoderException( msg );
        }

        // We can allocate the SearchRequest
        Filter substringFilter = new SubstringFilter( container.getTlvId() );
View Full Code Here

        if ( expectedLength == 0 )
        {
            LOG.error( "The length of controls must not be null" );

            // This will generate a PROTOCOL_ERROR
            throw new DecoderException( "The length of controls must not be null" );
        }

        if ( IS_DEBUG )
        {
            LOG.debug( "A new list of controls has been initialized" );
View Full Code Here

        if ( tlv.getLength() == 0 )
        {
            String msg = I18n.err( I18n.ERR_04007 );
            LOG.error( msg );
            throw new DecoderException( msg );
        }
        else
        {
            String type = Strings.utf8ToString(tlv.getValue().getData());
            assertion.setAttributeDesc( type );
View Full Code Here

        if ( tlv.getLength() == 0 )
        {
            String msg = I18n.err( I18n.ERR_04006 );
            LOG.error( msg );
            throw new DecoderException( msg );
        }

        SearchRequestDecorator searchRequestDecorator = container.getMessage();

        // We can allocate the SearchRequest
View Full Code Here

                referral.addLdapUrl( urlStr );
            }
            catch ( LdapURLEncodingException luee )
            {
                LOG.error( I18n.err( I18n.ERR_04021, urlStr, luee.getMessage() ) );
                throw new DecoderException( I18n.err( I18n.ERR_04016, luee.getMessage() ) );
            }
        }

        if ( IS_DEBUG )
        {
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.asn1.DecoderException

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.