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

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


            }
        }

        if ( invalid )
        {
            throw new LdapOperationNotSupportedException( "cannot place an entry below itself",
                ResultCodeEnum.UNWILLING_TO_PERFORM );
        }

    }
View Full Code Here


            }

            // if the supertype is provided make sure it exists in some schema
            if ( ( attributeType.getSuperiorOid() != null ) && !schemaManager.getAttributeTypeRegistry().contains( attributeType.getSuperiorOid() ) )
            {
                throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_409, attributeType.getSuperiorOid() ),
                    ResultCodeEnum.UNWILLING_TO_PERFORM );
            }

            // if the syntax is provided by the description make sure it exists in some schema
            if ( attributeType.getSyntaxOid() != null && !schemaManager.getLdapSyntaxRegistry().contains( attributeType.getSyntaxOid() ) )
            {
                throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_410, attributeType.getSyntaxOid() ),
                    ResultCodeEnum.UNWILLING_TO_PERFORM );
            }

            // if the matchingRule is provided make sure it exists in some schema
            if ( attributeType.getEqualityOid() != null && !schemaManager.getMatchingRuleRegistry().contains( attributeType.getEqualityOid() ) )
            {
                throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_411, attributeType.getEqualityOid() ),
                    ResultCodeEnum.UNWILLING_TO_PERFORM );
            }

            // if the matchingRule is provided make sure it exists in some schema
            if ( attributeType.getOrderingOid() != null && !schemaManager.getMatchingRuleRegistry().contains( attributeType.getOrderingOid() ) )
            {
                throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_412, attributeType.getOrderingOid() ),
                    ResultCodeEnum.UNWILLING_TO_PERFORM );
            }

            // if the matchingRule is provided make sure it exists in some schema
            if ( attributeType.getSubstringOid() != null && !schemaManager.getMatchingRuleRegistry().contains( attributeType.getSubstringOid() ) )
            {
                throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_413, attributeType.getSubstringOid() ),
                    ResultCodeEnum.UNWILLING_TO_PERFORM );
            }

            // if the equality matching rule is null and no super type is specified then there is
            // definitely no equality matchingRule that can be resolved.  We cannot use an attribute
            // without a matchingRule for search or for building indices not to mention lookups.
            if ( attributeType.getEqualityOid() == null )
            {
                if ( attributeType.getSuperiorOid() == null )
                {
                    throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_414 ), ResultCodeEnum.UNWILLING_TO_PERFORM );
                }
                else
                {
                    AttributeType superType = schemaManager
                        .lookupAttributeTypeRegistry( attributeType.getSuperiorOid() );

                    if ( superType == null )
                    {
                        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_415 ), ResultCodeEnum.UNWILLING_TO_PERFORM );
                    }
                }
            }

            // a syntax is mandatory for an attributeType and if not provided by the description
            // must be provided from some ancestor in the attributeType hierarchy; without either
            // of these the description definitely cannot resolve a syntax and cannot be allowed.
            // if a supertype exists then it must resolve a proper syntax somewhere in the hierarchy.
            if ( attributeType.getSyntaxOid() == null && attributeType.getSuperiorOid() == null )
            {
                throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_416 ), ResultCodeEnum.UNWILLING_TO_PERFORM );
            }

            List<Throwable> errors = new ArrayList<Throwable>();

            attributeType.setRegistries( schemaManager.getRegistries() );
View Full Code Here

                        continue;
                    }

                    if ( !schemaManager.getObjectClassRegistry().contains( superiorOid ) )
                    {
                        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_418, superiorOid ),
                            ResultCodeEnum.UNWILLING_TO_PERFORM );
                    }
                }
            }

            // if the may list is provided make sure attributes exists in some schema
            if ( objectClass.getMayAttributeTypeOids() != null && objectClass.getMayAttributeTypeOids().size() > 0 )
            {
                for ( String mayAttrOid : objectClass.getMayAttributeTypeOids() )
                {
                    if ( !schemaManager.getAttributeTypeRegistry().contains( mayAttrOid ) )
                    {
                        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_419, mayAttrOid ),
                            ResultCodeEnum.UNWILLING_TO_PERFORM );
                    }
                }
            }

            // if the must list is provided make sure attributes exists in some schema
            if ( objectClass.getMustAttributeTypeOids() != null && objectClass.getMustAttributeTypeOids().size() > 0 )
            {
                for ( String mustAttrOid : objectClass.getMustAttributeTypeOids() )
                {
                    if ( !schemaManager.getAttributeTypeRegistry().contains( mustAttrOid ) )
                    {
                        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_420, mustAttrOid ),
                            ResultCodeEnum.UNWILLING_TO_PERFORM );
                    }
                }
            }
View Full Code Here

                throw iave;
            }

            if ( !schemaManager.getSyntaxCheckerRegistry().contains( ldapSyntax.getOid() ) )
            {
                throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_423 ), ResultCodeEnum.UNWILLING_TO_PERFORM );
            }

            ldapSyntax.setHumanReadable( isHumanReadable( ldapSyntax ) );
            syntaxes[pos++] = ldapSyntax;
        }
View Full Code Here

                throw iave;
            }

            if ( !schemaManager.getLdapSyntaxRegistry().contains( matchingRule.getSyntaxOid() ) )
            {
                throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_425, matchingRule.getSyntaxOid() ),
                    ResultCodeEnum.UNWILLING_TO_PERFORM );
            }

            matchingRules[pos++] = matchingRule;
        }
View Full Code Here

        if ( level == AuthenticationLevel.UNAUTHENT )
        {
            // This is a case where the Bind request contains a DN, but no password.
            // We don't check the DN, we just return a UnwillingToPerform error
            // Cf RFC 4513, chap. 5.1.2
            throw new LdapOperationNotSupportedException( "Cannot Bind for DN " + opContext.getDn().getName(), ResultCodeEnum.UNWILLING_TO_PERFORM );
        }

        Collection<Authenticator> authenticators = getAuthenticators( level.getName() );

        if ( authenticators == null )
View Full Code Here

            else
            {
                String msg = I18n.err( I18n.ERR_386, entry.getDn().getName(),
                    StringTools.listToString( schemaManager.getErrors() ) );
                LOG.info( msg );
                throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
            }
        }
        else
        {
            LOG.debug( "The SyntaxChecker {} cannot be added in the disabled schema {}", dn.getName(), schemaName );
View Full Code Here

            else
            {
                String msg = I18n.err( I18n.ERR_386, entry.getDn().getName(),
                    StringTools.listToString( schemaManager.getErrors() ) );
                LOG.info( msg );
                throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
            }
        }
        else
        {
            LOG.debug( "The syntaxChecker {} cannot be deleted from the disabled schema {}", dn.getName(), schemaName );
View Full Code Here

        String oldOid = getOid( entry );
        String schemaName = getSchemaName( entry.getDn() );

        if ( schemaManager.getLdapSyntaxRegistry().contains( oldOid ) )
        {
            throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_389, oldOid ),
                ResultCodeEnum.UNWILLING_TO_PERFORM );
        }

        ServerEntry targetEntry = ( ServerEntry ) entry.clone();
        String newOid = ( String ) newRdn.getNormValue();
View Full Code Here

        String oldSchemaName = getSchemaName( oriChildName );
        String newSchemaName = getSchemaName( newParentName );

        if ( schemaManager.getLdapSyntaxRegistry().contains( oldOid ) )
        {
            throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_391, oldOid ),
                ResultCodeEnum.UNWILLING_TO_PERFORM );
        }

        ServerEntry targetEntry = ( ServerEntry ) entry.clone();
View Full Code Here

TOP

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

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.