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

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


    private void checkNewParent( LdapDN 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 ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
        {
            throw new LdapInvalidNameException( "The parent entry of a objectClass should be an organizationalUnit.",
                ResultCodeEnum.NAMING_VIOLATION );
        }
       
        if ( ! ( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.OBJECT_CLASSES_AT ) )
        {
            throw new LdapInvalidNameException(
                "The parent entry of a attributeType should have a relative name of ou=objectClasses.",
                ResultCodeEnum.NAMING_VIOLATION );
        }
    }
View Full Code Here


   
    private void checkNewParent( LdapDN newParent ) throws NamingException
    {
        if ( newParent.size() != 3 )
        {
            throw new LdapInvalidNameException(
                "The parent dn of a matchingRule should be at most 3 name components in length.",
                ResultCodeEnum.NAMING_VIOLATION );
        }
       
        Rdn rdn = newParent.getRdn();
        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
        {
            throw new LdapInvalidNameException( "The parent entry of a matchingRule should be an organizationalUnit.",
                ResultCodeEnum.NAMING_VIOLATION );
        }
       
        if ( ! ( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.MATCHING_RULES_AT ) )
        {
            throw new LdapInvalidNameException(
                "The parent entry of a syntax should have a relative name of ou=matchingRules.",
                ResultCodeEnum.NAMING_VIOLATION );
        }
    }
View Full Code Here

    private void checkNewParent( LdapDN newParent ) throws NamingException
    {
        if ( newParent.size() != 3 )
        {
            throw new LdapInvalidNameException(
                "The parent dn of a comparator should be at most 3 name components in length.",
                ResultCodeEnum.NAMING_VIOLATION );
        }
       
        Rdn rdn = newParent.getRdn();
        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
        {
            throw new LdapInvalidNameException( "The parent entry of a comparator should be an organizationalUnit.",
                ResultCodeEnum.NAMING_VIOLATION );
        }
       
        if ( ! ( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.COMPARATORS_AT ) )
        {
            throw new LdapInvalidNameException(
                "The parent entry of a comparator should have a relative name of ou=comparators.",
                ResultCodeEnum.NAMING_VIOLATION );
        }
    }
View Full Code Here

   
    private void checkNewParent( LdapDN newParent ) throws NamingException
    {
        if ( newParent.size() != 3 )
        {
            throw new LdapInvalidNameException(
                "The parent dn of a attributeType should be at most 3 name components in length.",
                ResultCodeEnum.NAMING_VIOLATION );
        }
       
        Rdn rdn = newParent.getRdn();
        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
        {
            throw new LdapInvalidNameException( "The parent entry of a attributeType should be an organizationalUnit.",
                ResultCodeEnum.NAMING_VIOLATION );
        }
       
        if ( ! ( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.ATTRIBUTE_TYPES_AT ) )
        {
            throw new LdapInvalidNameException(
                "The parent entry of a attributeType should have a relative name of ou=attributeTypes.",
                ResultCodeEnum.NAMING_VIOLATION );
        }
    }
View Full Code Here

        LdapDN parentDn = ( LdapDN ) name.clone();
        parentDn.remove( parentDn.size() - 1 );
        parentDn.normalize( globalRegistries.getAttributeTypeRegistry().getNormalizerMapping() );
        if ( !parentDn.toNormName().equals( OU_OID + "=schema" ) )
        {
            throw new LdapInvalidNameException( "The parent dn of a schema should be " + OU_OID + "=schema and not: "
                + parentDn.toNormName(), ResultCodeEnum.NAMING_VIOLATION );
        }

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

       
        if ( oc.contains( SchemaConstants.ORGANIZATIONAL_UNIT_OC ) )
        {
            if ( opContext.getDn().size() != 3 )
            {
                throw new LdapInvalidNameException(
                    "Schema entity containers of objectClass organizationalUnit should be 3 name components in length.",
                    ResultCodeEnum.NAMING_VIOLATION );
            }
           
            String ouValue = ( String ) opContext.getDn().getRdn().getValue();
            ouValue = ouValue.trim().toLowerCase();
            if ( ! VALID_OU_VALUES.contains( ouValue ) )
            {
                throw new LdapInvalidNameException(
                    "Expecting organizationalUnit with one of the following names: " + VALID_OU_VALUES,
                    ResultCodeEnum.NAMING_VIOLATION );
            }
            return;
        }
View Full Code Here

           
            String ouValue = ( String ) opContext.getDn().getRdn().getValue();
            ouValue = ouValue.trim().toLowerCase();
            if ( ! VALID_OU_VALUES.contains( ouValue ) )
            {
                throw new LdapInvalidNameException(
                    "Can only delete organizationalUnit entity containers with one of the following names: "
                    + VALID_OU_VALUES, ResultCodeEnum.NAMING_VIOLATION );
            }
            return;
        }
View Full Code Here

    private void checkNewParent( LdapDN newParent ) throws NamingException
    {
        if ( newParent.size() != 3 )
        {
            throw new LdapInvalidNameException(
                "The parent dn of a normalizer should be at most 3 name components in length.",
                ResultCodeEnum.NAMING_VIOLATION );
        }
       
        Rdn rdn = newParent.getRdn();
        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
        {
            throw new LdapInvalidNameException( "The parent entry of a normalizer should be an organizationalUnit.",
                ResultCodeEnum.NAMING_VIOLATION );
        }
       
        if ( ! ( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.NORMALIZERS_AT ) )
        {
            throw new LdapInvalidNameException(
                "The parent entry of a normalizer should have a relative name of ou=normalizers.",
                ResultCodeEnum.NAMING_VIOLATION );
        }
    }
View Full Code Here

   
    private void checkNewParent( LdapDN newParent ) throws NamingException
    {
        if ( newParent.size() != 3 )
        {
            throw new LdapInvalidNameException(
                "The parent dn of a syntaxChecker should be at most 3 name components in length.",
                ResultCodeEnum.NAMING_VIOLATION );
        }
       
        Rdn rdn = newParent.getRdn();
        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
        {
            throw new LdapInvalidNameException( "The parent entry of a syntaxChecker should be an organizationalUnit.",
                ResultCodeEnum.NAMING_VIOLATION );
        }
       
        if ( ! ( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.SYNTAX_CHECKERS_AT ) )
        {
            throw new LdapInvalidNameException(
                "The parent entry of a normalizer should have a relative name of ou=syntaxCheckers.",
                ResultCodeEnum.NAMING_VIOLATION );
        }
    }
View Full Code Here

   
    private void checkNewParent( LdapDN newParent ) throws NamingException
    {
        if ( newParent.size() != 3 )
        {
            throw new LdapInvalidNameException(
                "The parent dn of a syntax should be at most 3 name components in length.",
                ResultCodeEnum.NAMING_VIOLATION );
        }
       
        Rdn rdn = newParent.getRdn();
        if ( ! targetRegistries.getOidRegistry().getOid( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
        {
            throw new LdapInvalidNameException( "The parent entry of a syntax should be an organizationalUnit.",
                ResultCodeEnum.NAMING_VIOLATION );
        }
       
        if ( ! ( ( String ) rdn.getValue() ).equalsIgnoreCase( "syntaxes" ) )
        {
            throw new LdapInvalidNameException(
                "The parent entry of a syntax should have a relative name of ou=syntaxes.",
                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.