Package org.apache.directory.shared.ldap.exception

Examples of org.apache.directory.shared.ldap.exception.LdapInvalidNameException


    private void checkNewParent( DN newParent ) throws NamingException
    {
        if ( newParent.size() != 3 )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_396 ),
                ResultCodeEnum.NAMING_VIOLATION );
        }

        RDN rdn = newParent.getRdn();
        if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
            SchemaConstants.OU_AT_OID ) )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_397 ),
                ResultCodeEnum.NAMING_VIOLATION );
        }

        if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.SYNTAX_CHECKERS_AT ) )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_372 ),
                ResultCodeEnum.NAMING_VIOLATION );
        }
    }
View Full Code Here


    private void checkNewParent( DN newParent ) throws NamingException
    {
        if ( newParent.size() != 3 )
        {
            throw new LdapInvalidNameException(
                "The parent dn of a objectClass should be at most 3 name components in length.",
                ResultCodeEnum.NAMING_VIOLATION );
        }

        RDN rdn = newParent.getRdn();

        if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
            SchemaConstants.OU_AT_OID ) )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_376 ),
                ResultCodeEnum.NAMING_VIOLATION );
        }

        if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.OBJECT_CLASSES_AT ) )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_377 ),
                ResultCodeEnum.NAMING_VIOLATION );
        }
    }
View Full Code Here

    private void checkNewParent( DN newParent ) throws NamingException
    {
        if ( newParent.size() != 3 )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_361 ),
                ResultCodeEnum.NAMING_VIOLATION );
        }

        RDN rdn = newParent.getRdn();
       
        if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
            SchemaConstants.OU_AT_OID ) )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_362 ),
                ResultCodeEnum.NAMING_VIOLATION );
        }

        if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.MATCHING_RULES_AT ) )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_363 ),
                ResultCodeEnum.NAMING_VIOLATION );
        }
    }
View Full Code Here

    private void checkNewParent( DN newParent ) throws NamingException
    {
        if ( newParent.size() != 3 )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_402 ),
                ResultCodeEnum.NAMING_VIOLATION );
        }

        RDN rdn = newParent.getRdn();
        if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
            SchemaConstants.OU_AT_OID ) )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_403 ), ResultCodeEnum.NAMING_VIOLATION );
        }

        if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( "syntaxes" ) )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_363 ), ResultCodeEnum.NAMING_VIOLATION );
        }
    }
View Full Code Here

        parentDn.remove( parentDn.size() - 1 );
        parentDn.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );

        if ( !parentDn.equals( ouSchemaDN ) )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_380, ouSchemaDN.getName(),
                parentDn.toNormName() ), ResultCodeEnum.NAMING_VIOLATION );
        }

        // check if the new schema is enabled or disabled
        boolean isEnabled = false;
View Full Code Here

    private void checkNewParent( DN newParent ) throws NamingException
    {
        if ( newParent.size() != 3 )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_357 ),
                ResultCodeEnum.NAMING_VIOLATION );
        }

        RDN rdn = newParent.getRdn();

        if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
            SchemaConstants.OU_AT_OID ) )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_358 ), ResultCodeEnum.NAMING_VIOLATION );
        }

        if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.COMPARATORS_AT ) )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_359 ), ResultCodeEnum.NAMING_VIOLATION );
        }
    }
View Full Code Here

        {
            if ( opContext.getDn().size() != 3 )
            {
                String msg = I18n.err( I18n.ERR_81 );
                LOG.error( msg );
                throw new LdapInvalidNameException( msg, ResultCodeEnum.NAMING_VIOLATION );
            }
           
            String ouValue = ( String ) opContext.getDn().getRdn().getNormValue();
            ouValue = ouValue.trim().toLowerCase();
           
            if ( ! VALID_OU_VALUES.contains( ouValue ) )
            {
                String msg = I18n.err( I18n.ERR_82, VALID_OU_VALUES );
                LOG.error( msg );
                throw new LdapInvalidNameException( msg, ResultCodeEnum.NAMING_VIOLATION );
            }
           
            // this is a valid container.
            return;
        }
View Full Code Here

            String ouValue = ( String ) opContext.getDn().getRdn().getNormValue();
            ouValue = ouValue.trim().toLowerCase();
           
            if ( ! VALID_OU_VALUES.contains( ouValue ) )
            {
                throw new LdapInvalidNameException( I18n.err( I18n.ERR_379, VALID_OU_VALUES ),
                    ResultCodeEnum.NAMING_VIOLATION );
            }
           
            return;
        }
View Full Code Here

    private void checkNewParent( DN newParent ) throws NamingException
    {
        if ( newParent.size() != 3 )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_370 ), ResultCodeEnum.NAMING_VIOLATION );
        }

        RDN rdn = newParent.getRdn();

        if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
            SchemaConstants.OU_AT_OID ) )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_371 ), ResultCodeEnum.NAMING_VIOLATION );
        }

        if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.NORMALIZERS_AT ) )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_372 ), ResultCodeEnum.NAMING_VIOLATION );
        }
    }
View Full Code Here

     */
    protected void checkParent( DN newParent, SchemaManager schemaManager, String objectType ) throws NamingException
    {
        if ( newParent.size() != 3 )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_337 ), ResultCodeEnum.NAMING_VIOLATION );
        }
       
        RDN rdn = newParent.getRdn();
       
        if ( ! schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_338, objectType ),
                ResultCodeEnum.NAMING_VIOLATION );
        }
       
        if ( ! ( ( String ) rdn.getNormValue() ).equalsIgnoreCase( OBJECT_TYPE_TO_PATH.get( objectType ) ) )
        {
            throw new LdapInvalidNameException( I18n.err( I18n.ERR_339, objectType,  OBJECT_TYPE_TO_PATH.get( objectType ) ),
                ResultCodeEnum.NAMING_VIOLATION );
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.exception.LdapInvalidNameException

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.