Package org.apache.directory.api.ldap.model.exception

Examples of org.apache.directory.api.ldap.model.exception.LdapInvalidDnException


            Rdn rdn = rdns.get( size() - 1 - i );
            Rdn rdnDescendant = rdnsAncestor.get( ancestor.size() - 1 - i );

            if ( !rdn.equals( rdnDescendant ) )
            {
                throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX );
            }
        }

        for ( int i = 0; i < rdns.size() - length; i++ )
        {
View Full Code Here


            Rdn rdn = rdns.get( i );
            Rdn rdnDescendant = rdnsDescendant.get( i );

            if ( !rdn.equals( rdnDescendant ) )
            {
                throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX );
            }
        }

        for ( int i = length; i < rdns.size(); i++ )
        {
View Full Code Here

            if ( !oidsMap.containsKey( type ) )
            {
                // No AttributeType : this is an error
                String msg = I18n.err( I18n.ERR_04268_OID_NOT_FOUND, atav.getType() );
                LOG.error( msg );
                throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, msg );
            }

            OidNormalizer oidNormalizer = oidsMap.get( type );

            if ( oidNormalizer != null )
            {
                try
                {
                    Ava newAva = new Ava(
                        atav.getType(),
                        oidNormalizer.getAttributeTypeOid(),
                        atav.getValue(),
                        oidNormalizer.getNormalizer().normalize( atav.getNormValue() ),
                        atav.getName() );
                    newAva.apply( schemaManager );

                    return newAva;
                }
                catch ( LdapException le )
                {
                    throw new LdapInvalidDnException( le.getMessage(), le );
                }
            }
            else
            {
                // We don't have a normalizer for this OID : just do nothing.
                return atav;
            }
        }
        else
        {
            // The type is empty : this is not possible...
            String msg = I18n.err( I18n.ERR_04209_EMPTY_TYPE_NOT_ALLOWED );
            LOG.error( msg );
            throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, msg );
        }
    }
View Full Code Here

                normalized = false;
            }

            if ( upName.length() < rdn.length() )
            {
                throw new LdapInvalidDnException( "Invalid RDN" );
            }

            upName = rdn;
        }
        else
View Full Code Here

            {
                normalizedValue = oidNormalizer.getNormalizer().normalize( value );
            }
            catch ( LdapException e )
            {
                throw new LdapInvalidDnException( e.getMessage(), e );
            }
        }

        switch ( nbAvas )
        {
View Full Code Here

    // from outside this package.
    /* Unspecified protection */void replaceAva( Ava value, int pos ) throws LdapInvalidDnException
    {
        if ( ( pos < 0 ) || ( pos > nbAvas ) )
        {
            throw new LdapInvalidDnException( "Cannot set the AVA at position " + pos );
        }

        String normalizedType = value.getNormType();

        switch ( nbAvas )
View Full Code Here

                // We already have an Ava. We have to put it in the HashMap
                // before adding a new one.
                // Check that the first AVA is not for the same attribute
                if ( avaType.equals( normalizedType ) )
                {
                    throw new LdapInvalidDnException( "Invalid RDN: the " + normalizedType
                        + " is already present in the RDN" );
                }

                // First, create the HashMap,
                avas = new ArrayList<Ava>();

                // and store the existing Ava into it.
                avas.add( ava );
                avaTypes = new MultiValueMap();
                avaTypes.put( avaType, ava );

                this.ava = null;

                // Now, fall down to the commmon case
                // NO BREAK !!!

            default:
                // Check that the AT is not already present
                if ( avaTypes.containsKey( normalizedType ) )
                {
                    throw new LdapInvalidDnException( "Invalid RDN: the " + normalizedType
                        + " is already present in the RDN" );
                }

                // add a new Ava
                avas.add( value );
View Full Code Here

        {
            dnParser.relativeDistinguishedNames( rdns );
        }
        catch ( Exception e )
        {
            throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, e.getMessage(), e );
        }
    }
View Full Code Here

        {
            dnParser.relativeDistinguishedName( rdn );
        }
        catch ( Exception e )
        {
            throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, e.getMessage(), e );
        }
    }
View Full Code Here

            }
            catch ( LdapException le )
            {
                String message = I18n.err( I18n.ERR_04188 );
                LOG.error( message );
                throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message, le );
            }

            try
            {
                createAva( schemaManager, upType, new BinaryValue( attributeType, upValue ) );
            }
            catch ( LdapInvalidAttributeValueException liave )
            {
                String message = I18n.err( I18n.ERR_04188 );
                LOG.error( message );
                throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, message, liave );
            }
        }
        else
        {
            createAva( upType, new BinaryValue( upValue ) );
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.exception.LdapInvalidDnException

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.