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

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


        AttributeType oldAt = factory.getAttributeType( entry, targetRegistries, oldSchema.getSchemaName() );
        Set<ServerEntry> dependees = dao.listAttributeTypeDependents( oldAt );
       
        if ( dependees != null && dependees.size() > 0 )
        {
            throw new LdapOperationNotSupportedException( "The attributeType with OID " + oldAt.getOid()
                + " cannot be deleted until all entities"
                + " using this attributeType have also been deleted.  The following dependees exist: "
                + getOids( dependees ),
                ResultCodeEnum.UNWILLING_TO_PERFORM );
        }
View Full Code Here


        // Before allowing a schema object to be deleted we must check
        // to make sure it's not depended upon by another schema
        Set<String> dependents = loader.listDependentSchemaNames( schemaName );
        if ( ! dependents.isEmpty() )
        {
            throw new LdapOperationNotSupportedException(
                "Cannot delete schema that has dependents: " + dependents,
                ResultCodeEnum.UNWILLING_TO_PERFORM );
        }
       
        // no need to check if schema is enabled or disabled here
View Full Code Here

    {
        String rdnAttribute = newRdn.getUpType();
        String rdnAttributeOid = globalRegistries.getOidRegistry().getOid( rdnAttribute );
        if ( ! rdnAttributeOid.equals( cnAT.getOid() ) )
        {
            throw new LdapOperationNotSupportedException(
                "Cannot allow rename with rdnAttribute set to "
                + rdnAttribute + ": cn must be used instead." ,
                ResultCodeEnum.UNWILLING_TO_PERFORM );
        }

        /*
         * This operation has to do the following:
         *
         * [1] check and make sure there are no dependent schemas on the
         *     one being renamed - if so an exception should result
         *     
         * [2] make non-schema object registries modify the mapping
         *     for their entities: non-schema object registries contain
         *     objects that are not SchemaObjects and hence do not carry
         *     their schema within the object as a property
         *    
         * [3] make schema object registries do the same but the way
         *     they do them will be different since these objects will
         *     need to be replaced or will require a setter for the
         *     schema name
         */
       
        // step [1]
        String schemaName = getSchemaName( name );
        Set<String> dependents = loader.listDependentSchemaNames( schemaName );
        if ( ! dependents.isEmpty() )
        {
            throw new LdapOperationNotSupportedException(
                "Cannot allow a rename on " + schemaName + " schema while it has depentents.",
                ResultCodeEnum.UNWILLING_TO_PERFORM );
        }

        // check if the new schema is enabled or disabled
View Full Code Here

     * UNWILLING_TO_PERFORM LdapException.
     */
    public void move( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn,
        ServerEntry entry, boolean cascade ) throws NamingException
    {
        throw new LdapOperationNotSupportedException( "Moving around schemas is not allowed.",
            ResultCodeEnum.UNWILLING_TO_PERFORM );
    }
View Full Code Here

     * UNWILLING_TO_PERFORM LdapException.
     */
    public void replace( LdapDN oriChildName, LdapDN newParentName,
        ServerEntry entry, boolean cascade ) throws NamingException
    {
        throw new LdapOperationNotSupportedException( "Moving around schemas is not allowed.",
            ResultCodeEnum.UNWILLING_TO_PERFORM );
    }
View Full Code Here

       
        Set<String> dependents = loader.listEnabledDependentSchemaNames( schemaName );
       
        if ( ! dependents.isEmpty() )
        {
            throw new LdapOperationNotSupportedException(
                "Cannot disable schema with enabled dependents: " + dependents,
                ResultCodeEnum.UNWILLING_TO_PERFORM );
        }
        schema.disable();
       
View Full Code Here

            {
                String dependency = value.getString();
               
                if ( ! loaded.containsKey( dependency ) )
                {
                    throw new LdapOperationNotSupportedException(
                        "Unwilling to perform operation on enabled schema with disabled or missing dependencies: "
                        + dependency, ResultCodeEnum.UNWILLING_TO_PERFORM );
                }
            }
        }
        else
        {
            Set<String> allSchemas = loader.getSchemaNames();
           
            for ( Value<?> value:dependencies )
            {
                String dependency = value.getString();
               
                if ( ! allSchemas.contains( dependency ) )
                {
                    throw new LdapOperationNotSupportedException(
                        "Unwilling to perform operation on schema with missing dependencies: " + dependency,
                        ResultCodeEnum.UNWILLING_TO_PERFORM );
                }
            }
        }
View Full Code Here

    {
        LdapDN name = opContext.getDn();
       
        if ( name.getNormName().equalsIgnoreCase( subschemSubentryDn.getNormName() ) )
        {
            throw new LdapOperationNotSupportedException(
                "Can not allow the deletion of the subschemaSubentry (" +
                subschemSubentryDn + ") for the global schema.",
                ResultCodeEnum.UNWILLING_TO_PERFORM );
        }
       
View Full Code Here

    {
        LdapDN dn = opContext.getDn();
       
        if ( dn.getNormName().equalsIgnoreCase( subschemSubentryDn.getNormName() ) )
        {
            throw new LdapOperationNotSupportedException(
                "Can not allow the renaming of the subschemaSubentry (" +
                subschemSubentryDn + ") for the global schema: it is fixed at " + subschemSubentryDn,
                ResultCodeEnum.UNWILLING_TO_PERFORM );
        }
       
View Full Code Here

        LdapDN oriChildName = opContext.getDn();
        LdapDN newParentName = opContext.getParent();
       
        if ( oriChildName.getNormName().equalsIgnoreCase( subschemSubentryDn.getNormName() ) )
        {
            throw new LdapOperationNotSupportedException(
                "Can not allow the move of the subschemaSubentry (" +
                subschemSubentryDn + ") for the global schema: it is fixed at " + subschemSubentryDn,
                ResultCodeEnum.UNWILLING_TO_PERFORM );
        }
       
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.