Package org.apache.directory.server.schema.bootstrap

Examples of org.apache.directory.server.schema.bootstrap.Schema


    }


    public void add( MatchingRule mr ) throws Exception
    {
        Schema schema = loader.getSchema( mr.getSchema() );
       
        if ( ! schema.isDisabled() )
        {
            matchingRuleRegistry.register( mr );
        }
        else
        {
View Full Code Here


   
    protected boolean modify( LdapDN name, ServerEntry entry, ServerEntry targetEntry, boolean cascade ) throws Exception
    {
        String oid = getOid( entry );
        Comparator comparator = factory.getComparator( targetEntry, targetRegistries );
        Schema schema = getSchema( name );
       
        if ( ! schema.isDisabled() )
        {
            comparatorRegistry.unregister( oid );
            ComparatorDescription description = getComparatorDescription( schema.getSchemaName(), targetEntry );
            comparatorRegistry.register( description, comparator );
           
            return SCHEMA_MODIFIED;
        }
       
View Full Code Here

        parentDn.remove( parentDn.size() - 1 );
        checkNewParent( parentDn );
        checkOidIsUniqueForComparator( entry );
       
        Comparator comparator = factory.getComparator( entry, targetRegistries );
        Schema schema = getSchema( name );
       
        if ( ! schema.isDisabled() )
        {
            ComparatorDescription comparatorDescription = getComparatorDescription( schema.getSchemaName(), entry );
            comparatorRegistry.register( comparatorDescription, comparator );
        }
    }
View Full Code Here

        if ( comparatorDescription.getExtensions().get( MetaSchemaConstants.X_SCHEMA ) != null )
        {
            schemaName = comparatorDescription.getExtensions().get( MetaSchemaConstants.X_SCHEMA ).get( 0 );
        }
       
        Schema schema = loader.getSchema( schemaName );
       
        if ( ! schema.isDisabled() )
        {
            comparatorRegistry.register( comparatorDescription, comparator );
        }
    }
View Full Code Here

                ResultCodeEnum.UNWILLING_TO_PERFORM );
        }

        String oid = ( String ) newRdn.getValue();
        checkOidIsUniqueForComparator( oid );
        Schema schema = getSchema( name );
       
        if ( ! schema.isDisabled() )
        {
            Comparator comparator = factory.getComparator( entry, targetRegistries );
            comparatorRegistry.unregister( oldOid );
            ComparatorDescription comparatorDescription = getComparatorDescription( schema.getSchemaName(), entry );
            comparatorDescription.setNumericOid( oid );
            comparatorRegistry.register( comparatorDescription, comparator );
        }
    }
View Full Code Here

        }

        String oid = ( String ) newRdn.getValue();
        checkOidIsUniqueForComparator( oid );
       
        Schema oldSchema = getSchema( oriChildName );
        Schema newSchema = getSchema( newParentName );
       
        Comparator comparator = factory.getComparator( entry, targetRegistries );

        if ( ! oldSchema.isDisabled() )
        {
            comparatorRegistry.unregister( oldOid );
        }

        if ( ! newSchema.isDisabled() )
        {
            ComparatorDescription comparatorDescription = getComparatorDescription( newSchema.getSchemaName(), entry );
            comparatorDescription.setNumericOid( oid );
            comparatorRegistry.register( comparatorDescription, comparator );
        }
    }
View Full Code Here

                + " cannot be moved to another schema until all "
                + "matchingRules using that comparator have been deleted.",
                ResultCodeEnum.UNWILLING_TO_PERFORM );
        }

        Schema oldSchema = getSchema( oriChildName );
        Schema newSchema = getSchema( newParentName );
       
        Comparator comparator = factory.getComparator( entry, targetRegistries );
       
        if ( ! oldSchema.isDisabled() )
        {
            comparatorRegistry.unregister( oid );
        }
       
        if ( ! newSchema.isDisabled() )
        {
            ComparatorDescription comparatorDescription = getComparatorDescription( newSchema.getSchemaName(), entry );
            comparatorRegistry.register( comparatorDescription, comparator );
        }
    }
View Full Code Here

         * fail.
         */

        if ( isEnabled )
        {
            Schema schema = factory.getSchema( entry );
            globalRegistries.addToLoadedSet( schema );
        }
    }
View Full Code Here

    private boolean disableSchema( String schemaName ) throws Exception
    {
        // First check that the schema is not already disabled
        Map<String, Schema> schemas = globalRegistries.getLoadedSchemas();
       
        Schema schema = schemas.get( schemaName );
       
        if ( ( schema == null ) || schema.isDisabled() )
        {
            // The schema is disabled, do nothing
            return SCHEMA_UNCHANGED;
        }
       
        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();
       
        globalRegistries.unload( schemaName );
       
        return SCHEMA_MODIFIED;
    }
View Full Code Here

        {
            // TODO log warning: schemaName + " was already loaded"
            return SCHEMA_UNCHANGED;
        }

        Schema schema = loader.getSchema( schemaName );
        loader.loadWithDependencies( schema, globalRegistries );
        schema.enable();
       
        return SCHEMA_MODIFIED;
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.server.schema.bootstrap.Schema

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.