Examples of LdapSchemaViolationException


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

            if ( !isAdmin )
            {
                // Wrong !
                String message = I18n.err( I18n.ERR_30, SchemaConstants.ENTRY_UUID_AT );
                LOG.error( message );
                throw new LdapSchemaViolationException( message, ResultCodeEnum.INSUFFICIENT_ACCESS_RIGHTS );
            }
        }
        else
        {
            entry.put( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
        }
           
        if ( entry.containsAttribute( SchemaConstants.ENTRY_CSN_AT ) )
        {
            if ( !isAdmin )
            {
                // Wrong !
                String message =  I18n.err( I18n.ERR_30, SchemaConstants.ENTRY_CSN_AT );
                LOG.error( message );
                throw new LdapSchemaViolationException( message, ResultCodeEnum.INSUFFICIENT_ACCESS_RIGHTS );
            }
        }
        else
        {
            entry.put( SchemaConstants.ENTRY_CSN_AT, service.getCSN().toString() );
View Full Code Here

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

           
            if ( attributeType.equals( MODIFIERS_NAME_ATTRIBUTE_TYPE ) )
            {
                String message = I18n.err( I18n.ERR_31 );
                LOG.error( message );
                throw new LdapSchemaViolationException( message, ResultCodeEnum.INSUFFICIENT_ACCESS_RIGHTS );
            }

            if ( attributeType.equals( MODIFY_TIMESTAMP_ATTRIBUTE_TYPE ) )
            {
                String message = I18n.err( I18n.ERR_32 );
                LOG.error( message );
                throw new LdapSchemaViolationException( message, ResultCodeEnum.INSUFFICIENT_ACCESS_RIGHTS );
            }
        }
       
        // Inject the ModifiersName AT if it's not present
        ServerAttribute attribute = new DefaultServerAttribute(
View Full Code Here

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

        {
            return schemaManager.getGlobalOidRegistry().getSchemaObject( oid );
        }
        else
        {
            throw new LdapSchemaViolationException( I18n.err( I18n.ERR_336, oid ),
                ResultCodeEnum.OTHER );
        }
    }
View Full Code Here

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

    {
        String oid = schemaObject.getOid();

        if ( schemaManager.getGlobalOidRegistry().contains( oid ) )
        {
            throw new LdapSchemaViolationException( I18n.err( I18n.ERR_335, oid ),
                ResultCodeEnum.OTHER );
        }
    }
View Full Code Here

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

    protected void checkOidIsUnique( String oid ) throws Exception
    {
        if ( schemaManager.getGlobalOidRegistry().contains( oid ) )
        {
            throw new LdapSchemaViolationException( I18n.err( I18n.ERR_335, oid ),
                ResultCodeEnum.OTHER );
        }
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.exception.LdapSchemaViolationException

        catch ( LdapException ne )
        {
            // Not allowed.
            String msg = I18n.err( I18n.ERR_04293, schemaObject.getName(), ne.getLocalizedMessage() );

            Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, msg, ne );
            errors.add( error );
            LOG.info( msg );
        }
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.exception.LdapSchemaViolationException

        Normalizer normalizer = matchingRule.getNormalizer();

        if ( normalizer == null )
        {
            // Ok, no normalizer, this is an error
            Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err(
                I18n.ERR_04295, matchingRule.getOid() ) );
            errors.add( error );
        }

        // Process the Comparator
        LdapComparator<?> comparator = matchingRule.getLdapComparator();

        if ( comparator == null )
        {
            // Ok, no comparator, this is an error
            Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err(
                I18n.ERR_04296, matchingRule.getOid() ) );
            errors.add( error );
        }
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.exception.LdapSchemaViolationException

                    processed.add( attributeType.getOid() );
                }
                else
                {
                    // Not allowed : we have a cyle
                    Throwable error = new LdapSchemaViolationException( ResultCodeEnum.OTHER, I18n.err( I18n.ERR_04297,
                        attributeType.getOid() ) );
                    errors.add( error );
                    return;
                }
            }
        }

        // Process the Syntax. If it's null, the attributeType must have
        // a Superior.
        String syntaxOid = attributeType.getSyntaxOid();

        if ( syntaxOid != null )
        {
            // Check if the Syntax is present in the registries
            try
            {
                ldapSyntaxRegistry.lookup( syntaxOid );
            }
            catch ( LdapException ne )
            {
                // This AT's syntax has not been loaded into the Registries.
                errors.add( ne );
            }
        }
        else
        {
            // No Syntax : get it from the AttributeType's superior
            if ( superior == null )
            {
                // This is an error. if the AT does not have a Syntax,
                // then it must have a superior, which syntax is get from.
                Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err(
                    I18n.ERR_04298, attributeType.getOid() ) );
                errors.add( error );
            }
        }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.exception.LdapSchemaViolationException

        catch ( LdapException ne )
        {
            // Not allowed.
            String msg = I18n.err( I18n.ERR_04293, schemaObject.getName(), ne.getLocalizedMessage() );

            Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, msg );
            errors.add( error );
            LOG.info( msg );
        }
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.exception.LdapSchemaViolationException

        Normalizer normalizer = matchingRule.getNormalizer();

        if ( normalizer == null )
        {
            // Ok, no normalizer, this is an error
            Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err(
                I18n.ERR_04295, matchingRule.getOid() ) );
            errors.add( error );
        }

        // Process the Comparator
        LdapComparator<?> comparator = matchingRule.getLdapComparator();

        if ( comparator == null )
        {
            // Ok, no comparator, this is an error
            Throwable error = new LdapSchemaViolationException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, I18n.err(
                I18n.ERR_04296, matchingRule.getOid() ) );
            errors.add( error );
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.