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

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


       
        if ( oc.contains( SchemaConstants.ORGANIZATIONAL_UNIT_OC ) )
        {
            if ( opContext.getDn().size() != 3 )
            {
                throw new LdapNamingException(
                    "Only schema entity containers of objectClass organizationalUnit with 3 name components in length" +
                    " can be deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM );
            }
           
            String ouValue = ( String ) opContext.getDn().getRdn().getValue();
View Full Code Here


            }
            catch ( ParseException e )
            {
                String msg = "failed to parse entryTrigger: " + triggerString;
                LOG.error( msg, e );
                throw new LdapNamingException( msg, ResultCodeEnum.OPERATIONS_ERROR );
            }

            triggerSpecs.add( item );
        }
    }
View Full Code Here

            StoredProcEngine engine = manager.getStoredProcEngineInstance( spUnit );
            return engine.invokeProcedure( opContext.getSession(), procedure, values );
        }
        catch ( Exception e )
        {
            LdapNamingException lne = new LdapNamingException( ResultCodeEnum.OTHER );
            lne.setRootCause( e );
            throw lne;
        }
    }
View Full Code Here

            }
            catch ( ParseException e )
            {
                String msg = "failed to parse subentryACI: " + aciString;
                LOG.error( msg, e );
                throw new LdapNamingException( msg, ResultCodeEnum.OPERATIONS_ERROR );
            }

            tuples.addAll( item.toTuples() );
        }
    }
View Full Code Here

        {
            if ( aliasDn.equals( normalizedAliasTargetDn ) )
            {
                String msg = "[36] aliasDereferencingProblem - attempt to create alias to itself.";
                ResultCodeEnum rc = ResultCodeEnum.ALIAS_DEREFERENCING_PROBLEM;
                LdapNamingException e = new LdapNamingException( msg, rc );
                e.setResolvedName( aliasDn );
                throw e;
            }

            String msg = "[36] aliasDereferencingProblem - "
                + "attempt to create alias with cycle to relative " + aliasTarget
                + " not allowed from descendent alias " + aliasDn;
            ResultCodeEnum rc = ResultCodeEnum.ALIAS_DEREFERENCING_PROBLEM;
            LdapNamingException e = new LdapNamingException( msg, rc );
            e.setResolvedName( aliasDn );
            throw e;
        }

        /*
         * Check For Aliases External To Naming Context
         *
         * id may be null but the alias may be to a valid entry in
         * another namingContext.  Such aliases are not allowed and we
         * need to point it out to the user instead of saying the target
         * does not exist when it potentially could outside of this upSuffix.
         */
        if ( !normalizedAliasTargetDn.startsWith( normSuffix ) )
        {
            String msg = "[36] aliasDereferencingProblem - "
                + " the alias points to an entry outside of the " + upSuffix.getUpName()
                + " namingContext to an object whose existence cannot be determined.";
            ResultCodeEnum rc = ResultCodeEnum.ALIAS_DEREFERENCING_PROBLEM;
            LdapNamingException e = new LdapNamingException( msg, rc );
            e.setResolvedName( aliasDn );
            throw e;
        }

        // L O O K U P   T A R G E T   I D
        targetId = ndnIdx.forwardLookup( normalizedAliasTargetDn.toNormName() );

        /*
         * Check For Target Existence
         *
         * We do not allow the creation of inconsistent aliases.  Aliases should
         * not be broken links.  If the target does not exist we start screaming
         */
        if ( null == targetId )
        {
            // Complain about target not existing
            String msg = "[33] aliasProblem - "
                + "the alias '" + aliasDn.getUpName() + "' when dereferenced would not name a known object."
                + "The aliased ObjectName '" + aliasTarget + "' must be set to a valid existing entry.";
            ResultCodeEnum rc = ResultCodeEnum.ALIAS_PROBLEM;
            LdapNamingException e = new LdapNamingException( msg, rc );
            e.setResolvedName( aliasDn );
            throw e;
        }

        /*
         * Detect Direct Alias Chain Creation
         *
         * Rather than resusitate the target to test if it is an alias and fail
         * due to chaing creation we use the alias index to determine if the
         * target is an alias.  Hence if the alias we are about to create points
         * to another alias as its target in the aliasedObjectName attribute,
         * then we have a situation where an alias chain is being created. 
         * Alias chaining is not allowed so we throw and exception.
         */
        if ( null != aliasIdx.reverseLookup( targetId ) )
        {
            String msg = "[36] aliasDereferencingProblem - "
                + " the alias points to another alias.  Alias chaining is not supported by this backend.";
            ResultCodeEnum rc = ResultCodeEnum.ALIAS_DEREFERENCING_PROBLEM;
            LdapNamingException e = new LdapNamingException( msg, rc );
            e.setResolvedName( aliasDn );
            throw e;
        }

        // Add the alias to the simple alias index
        aliasIdx.add( normalizedAliasTargetDn.getNormName(), aliasId );
View Full Code Here

   
    private void checkOidIsUniqueForNormalizer( String oid ) throws NamingException
    {
        if ( super.targetRegistries.getNormalizerRegistry().hasNormalizer( oid ) )
        {
            throw new LdapNamingException( "Oid " + oid + " for new schema normalizer is not unique.",
                ResultCodeEnum.OTHER );
        }
    }
View Full Code Here

    {
        String oid = getOid( entry );
       
        if ( super.targetRegistries.getNormalizerRegistry().hasNormalizer( oid ) )
        {
            throw new LdapNamingException( "Oid " + oid + " for new schema normalizer is not unique.",
                ResultCodeEnum.OTHER );
        }
    }
View Full Code Here

        {
            listing = new DbFileListing();
        }
        catch( IOException e )
        {
            throw new LdapNamingException( "Got IOException while trying to read DBFileListing: " + e.getMessage(),
                ResultCodeEnum.OTHER );
        }

        Set<Index<?,ServerEntry>> indexedAttributes = new HashSet<Index<?,ServerEntry>>();
       
View Full Code Here

        parentDn.remove( parentDn.size() - 1 );
        checkNewParent( parentDn );
        String oid = getOid( entry );
        if ( super.targetRegistries.getSyntaxCheckerRegistry().hasSyntaxChecker( oid ) )
        {
            throw new LdapNamingException( "Oid " + oid + " for new schema syntaxChecker is not unique.",
                ResultCodeEnum.OTHER );
        }
       
        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( entry, targetRegistries );
        Schema schema = getSchema( name );
View Full Code Here

        Schema schema = getSchema( name );
        ServerEntry targetEntry = ( ServerEntry ) entry.clone();
        String newOid = ( String ) newRdn.getValue();
        if ( super.targetRegistries.getSyntaxCheckerRegistry().hasSyntaxChecker( newOid ) )
        {
            throw new LdapNamingException( "Oid " + newOid + " for new schema syntaxChecker is not unique.",
                ResultCodeEnum.OTHER );
        }

        targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
        if ( ! schema.isDisabled() )
View Full Code Here

TOP

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

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.